Changes in / [8d61d620:f2f22e3]
- Files:
-
- 4 added
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/Makefile.am
r8d61d620 rf2f22e3 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Tue Nov 6 09:01:23 201814 ## Update Count : 2613 ## Last Modified On : Sun Jun 23 12:34:29 2019 14 ## Update Count : 52 15 15 ############################################################################### 16 16 … … 21 21 include $(top_srcdir)/src/cfa.make 22 22 23 AM_CFLAGS = -O2 -Wall -Wextra - Werror -I$(srcdir) -lrt -pthread23 AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror 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)) 33 34 34 35 __quiet = verbose … … 45 46 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 46 47 __bench_v_UPP_verbose = $(AM_V_UPP) 47 48 __bench_v_QTHREAD_verbose = $(AM_V_CC) 48 49 49 50 … … 51 52 REPEAT = ${abs_top_builddir}/tools/repeat 52 53 STATS = ${abs_top_srcdir}/tools/stat.py 53 repeats = 3 054 repeats = 3 # 30 54 55 skipcompile = no 55 56 TIME_FORMAT = "%E" … … 124 125 125 126 ctxswitch.csv: 126 @echo "coroutine,thread" > $@ 127 @echo "generator,coroutine,thread" > $@ 128 @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 127 129 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 128 130 @+make ctxswitch-cfa_thread.runquiet >> $@ … … 153 155 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 154 156 157 ttst_lock$(EXEEXT): 158 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/ttst_lock.c 159 155 160 tls-fetch_add$(EXEEXT): 156 161 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c … … 161 166 function.run \ 162 167 fetch_add.run \ 168 ttst_lock.run \ 163 169 tls-fetch_add.run \ 164 170 ctxswitch-pthread.run \ 171 ctxswitch-cfa_generator.run \ 165 172 ctxswitch-cfa_coroutine.run \ 166 173 ctxswitch-cfa_thread.run \ … … 169 176 ctxswitch-upp_thread.run \ 170 177 ctxswitch-goroutine.run \ 171 ctxswitch-java_thread.run 178 ctxswitch-java_thread.run \ 179 ctxswitch-qthreads.run 180 172 181 173 182 if WITH_LIBFIBRE … … 188 197 ctxswitch-pthread$(EXEEXT): 189 198 $(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.cfa 190 202 191 203 ctxswitch-cfa_coroutine$(EXEEXT): … … 212 224 @echo "java JavaThread" >> a.out 213 225 @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 -lqthread 214 229 215 230 ## ========================================================================================================= … … 305 320 creation-upp_thread.run \ 306 321 creation-goroutine.run \ 307 creation-java_thread.run 322 creation-java_thread.run \ 323 creation-qthreads.run 308 324 309 325 creation-cfa_coroutine$(EXEEXT): … … 333 349 @echo "java JavaThread" >> a.out 334 350 @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 -lqthread 335 354 336 355 ## ========================================================================================================= … … 375 394 compile-typeof$(EXEEXT): 376 395 @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa 377 -
benchmark/Makefile.in
r8d61d620 rf2f22e3 363 363 am__v_GOC_0 = @echo " GOC " $@; 364 364 am__v_GOC_1 = 365 UPPCC = u++ 365 UPPCC = u++-work 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 - Werror -I$(srcdir) -lrt -pthread373 AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror 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)) 382 383 __quiet = verbose 383 384 __bench_v_CC_quiet = @ … … 393 394 __bench_v_JAVAC_verbose = $(AM_V_JAVAC) 394 395 __bench_v_UPP_verbose = $(AM_V_UPP) 396 __bench_v_QTHREAD_verbose = $(AM_V_CC) 395 397 TOOLSDIR = ${abs_top_builddir}/tools/ 396 398 REPEAT = ${abs_top_builddir}/tools/repeat 397 399 STATS = ${abs_top_srcdir}/tools/stat.py 398 repeats = 3 0400 repeats = 3 # 30 399 401 skipcompile = no 400 402 TIME_FORMAT = "%E" … … 402 404 dummy_SOURCES = dummyC.c dummyCXX.cpp 403 405 FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@ 404 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \406 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run ttst_lock.run \ 405 407 tls-fetch_add.run ctxswitch-pthread.run \ 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) 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) 410 413 testdir = $(top_srcdir)/tests 411 414 all: all-am … … 784 787 785 788 ctxswitch.csv: 786 @echo "coroutine,thread" > $@ 789 @echo "generator,coroutine,thread" > $@ 790 @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@ 787 791 @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@ 788 792 @+make ctxswitch-cfa_thread.runquiet >> $@ … … 812 816 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/fetch_add.c 813 817 818 ttst_lock$(EXEEXT): 819 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/ttst_lock.c 820 814 821 tls-fetch_add$(EXEEXT): 815 822 $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000 $(srcdir)/tls-fetch_add.c … … 825 832 ctxswitch-pthread$(EXEEXT): 826 833 $(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.cfa 827 837 828 838 ctxswitch-cfa_coroutine$(EXEEXT): … … 849 859 @echo "java JavaThread" >> a.out 850 860 @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 -lqthread 851 864 852 865 mutex$(EXEEXT) :\ … … 937 950 creation-upp_thread.run \ 938 951 creation-goroutine.run \ 939 creation-java_thread.run 952 creation-java_thread.run \ 953 creation-qthreads.run 940 954 941 955 creation-cfa_coroutine$(EXEEXT): … … 965 979 @echo "java JavaThread" >> a.out 966 980 @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 -lqthread 967 984 968 985 compile$(EXEEXT) :\ -
benchmark/bench.h
r8d61d620 rf2f22e3 45 45 statement; \ 46 46 EndTime = bench_time(); \ 47 unsigned long long intoutput = \48 ( EndTime - StartTime ) / n;47 double output = \ 48 (double)( EndTime - StartTime ) / n; 49 49 50 50 #if defined(__cforall) -
benchmark/creation/cfa_cor.cfa
r8d61d620 rf2f22e3 10 10 #endif 11 11 } 12 void main(MyCoroutine & this) {}12 void main(MyCoroutine &) {} 13 13 14 14 int main(int argc, char* argv[]) { 15 15 BENCH( 16 for ( size_t i = 0; i < n; i++) {16 for ( i; n ) { 17 17 MyCoroutine m; 18 18 }, … … 20 20 ) 21 21 22 printf("% llu\n", result);22 printf("%g\n", result); 23 23 } -
benchmark/creation/cfa_thrd.cfa
r8d61d620 rf2f22e3 5 5 6 6 thread MyThread {}; 7 void main(MyThread & this) {}7 void main(MyThread &) {} 8 8 9 9 int main(int argc, char* argv[]) { 10 10 BENCH( 11 for ( size_t i = 0; i < n; i++) {11 for ( i; n ) { 12 12 MyThread m; 13 13 }, … … 15 15 ) 16 16 17 printf("% llu\n", result);17 printf("%g\n", result); 18 18 } -
benchmark/creation/pthreads.c
r8d61d620 rf2f22e3 25 25 ) 26 26 27 printf("% llu\n", result);27 printf("%g\n", result); 28 28 } -
benchmark/creation/upp_cor.cc
r8d61d620 rf2f22e3 15 15 ) 16 16 17 printf("% llu\n", result);17 printf("%g\n", result); 18 18 } -
benchmark/creation/upp_thrd.cc
r8d61d620 rf2f22e3 15 15 ) 16 16 17 printf("% llu\n", result);17 printf("%g\n", result); 18 18 } -
benchmark/ctxswitch/cfa_cor.cfa
r8d61d620 rf2f22e3 1 #include <stdio.h>2 1 #include <kernel.hfa> 3 2 #include <thread.hfa> … … 21 20 22 21 BENCH( 23 for ( size_t i = 0; i < n; i++) {22 for ( i; n ) { 24 23 resume( s ); 25 24 }, … … 27 26 ) 28 27 29 printf("% llu\n", result);28 printf("%g\n", result); 30 29 } -
benchmark/ctxswitch/cfa_cor_then.cfa
r8d61d620 rf2f22e3 1 #include <stdio.h>2 1 #include <kernel.hfa> 3 2 #include <thread.hfa> … … 23 22 24 23 BENCH( 25 for ( size_t i = 0; i < n; i++) {24 for ( i; n ) { 26 25 resume( s ); 27 26 }, … … 29 28 ) 30 29 31 printf("% llu\n", result);30 printf("%g\n", result); 32 31 } -
benchmark/ctxswitch/cfa_thrd.cfa
r8d61d620 rf2f22e3 1 #include <stdio.h>2 1 #include <thread.hfa> 3 2 … … 6 5 int main(int argc, char* argv[]) { 7 6 BENCH( 8 for ( size_t i = 0; i < n; i++) {7 for ( i; n ) { 9 8 yield(); 10 9 }, … … 12 11 ) 13 12 14 printf("% llu\n", result);13 printf("%g\n", result); 15 14 } -
benchmark/ctxswitch/cfa_thrd2.cfa
r8d61d620 rf2f22e3 1 #include <stdio.h>2 1 #include <thread.hfa> 3 2 … … 17 16 Fibre f1; 18 17 BENCH( 19 for ( size_t i = 0; i < n; i++) {18 for ( i; n ) { 20 19 yield(); 21 20 }, … … 23 22 ) 24 23 25 printf("% llu\n", result);24 printf("%g\n", result); 26 25 done = true; 27 26 return 0; -
benchmark/ctxswitch/kos_fibre.cpp
r8d61d620 rf2f22e3 10 10 result 11 11 ) 12 printf("% llu\n", result);12 printf("%g\n", result); 13 13 return 0; 14 14 } -
benchmark/ctxswitch/kos_fibre2.cpp
r8d61d620 rf2f22e3 19 19 result 20 20 ) 21 printf("% llu\n", result);21 printf("%g\n", result); 22 22 done = true; 23 23 Fibre::yield(); -
benchmark/ctxswitch/pthreads.c
r8d61d620 rf2f22e3 14 14 ) 15 15 16 printf("% llu\n", result);16 printf("%g\n", result); 17 17 } -
benchmark/ctxswitch/upp_cor.cc
r8d61d620 rf2f22e3 30 30 ) 31 31 32 printf("% llu\n", result);32 printf("%g\n", result); 33 33 } -
benchmark/ctxswitch/upp_thrd.cc
r8d61d620 rf2f22e3 11 11 ) 12 12 13 printf("% llu\n", result);13 printf("%g\n", result); 14 14 } -
benchmark/fetch_add.c
r8d61d620 rf2f22e3 19 19 ) 20 20 21 printf("% llu\n", result);21 printf("%g\n", result); 22 22 } -
benchmark/function.c
r8d61d620 rf2f22e3 15 15 ) 16 16 17 printf("% llu\n", result);17 printf("%g\n", result); 18 18 } -
benchmark/loop.c
r8d61d620 rf2f22e3 11 11 ) 12 12 13 printf("% llu\n", result);13 printf("%g\n", result); 14 14 } -
benchmark/mutex/cfa1.cfa
r8d61d620 rf2f22e3 10 10 M m; 11 11 BENCH( 12 for ( size_t i = 0; i < n; i++) {12 for ( i; n ) { 13 13 call(m); 14 14 }, … … 16 16 ) 17 17 18 printf("% llu\n", result);18 printf("%g\n", result); 19 19 } -
benchmark/mutex/cfa2.cfa
r8d61d620 rf2f22e3 10 10 M m1, m2; 11 11 BENCH( 12 for ( size_t i = 0; i < n; i++) {12 for ( i; n ) { 13 13 call(m1, m2); 14 14 }, … … 16 16 ) 17 17 18 printf("% llu\n", result);18 printf("%g\n", result); 19 19 } -
benchmark/mutex/cfa4.cfa
r8d61d620 rf2f22e3 11 11 M m1, m2, m3, m4; 12 12 BENCH( 13 for ( size_t i = 0; i < n; i++) {13 for ( i; n ) { 14 14 call(m1, m2, m3, m4); 15 15 }, … … 17 17 ) 18 18 19 printf("% llu\n", result);19 printf("%g\n", result); 20 20 } -
benchmark/mutex/pthreads.c
r8d61d620 rf2f22e3 19 19 ) 20 20 21 printf("% llu\n", result);21 printf("%g\n", result); 22 22 } -
benchmark/mutex/upp.cc
r8d61d620 rf2f22e3 17 17 ) 18 18 19 printf("% llu\n", result);19 printf("%g\n", result); 20 20 } -
benchmark/schedext/cfa1.cfa
r8d61d620 rf2f22e3 18 18 go = 1; 19 19 BENCH( 20 for ( size_t i = 0; i < n; i++) {20 for ( i; n ) { 21 21 waitfor(call, a1); 22 22 }, … … 24 24 ) 25 25 26 printf("% llu\n", result);26 printf("%g\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & this) {33 void main( T & ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1); } … … 37 37 } 38 38 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 40 T t; 43 41 return wait(m1); -
benchmark/schedext/cfa2.cfa
r8d61d620 rf2f22e3 18 18 go = 1; 19 19 BENCH( 20 for ( size_t i = 0; i < n; i++) {20 for ( i; n ) { 21 21 waitfor(call, a1, a2); 22 22 }, … … 24 24 ) 25 25 26 printf("% llu\n", result);26 printf("%g\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & this) {33 void main( T & ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1, m2); } … … 37 37 } 38 38 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 40 T t; 43 41 return wait(m1, m2); -
benchmark/schedext/cfa4.cfa
r8d61d620 rf2f22e3 18 18 go = 1; 19 19 BENCH( 20 for ( size_t i = 0; i < n; i++) {20 for ( i; n ) { 21 21 waitfor(call, a1, a2, a3, a4); 22 22 }, … … 24 24 ) 25 25 26 printf("% llu\n", result);26 printf("%g\n", result); 27 27 go = 0; 28 28 return 0; … … 31 31 thread T {}; 32 32 void ^?{}( T & mutex this ) {} 33 void main( T & this) {33 void main( T & ) { 34 34 while(go == 0) { yield(); } 35 35 while(go == 1) { call(m1, m2, m3, m4); } … … 37 37 } 38 38 39 int main(int margc, char* margv[]) { 40 argc = margc; 41 argv = margv; 39 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 42 40 T t; 43 41 return wait(m1, m2, m3, m4); -
benchmark/schedext/upp.cc
r8d61d620 rf2f22e3 20 20 ) 21 21 22 printf("% llu\n", result);22 printf("%g\n", result); 23 23 go = 0; 24 24 return 0; -
benchmark/schedint/cfa1.cfa
r8d61d620 rf2f22e3 21 21 go = 1; 22 22 BENCH( 23 for ( size_t i = 0; i < n; i++) {23 for ( i; n ) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% llu\n", result);29 printf("%g\n", result); 30 30 go = 0; 31 31 return 0; … … 33 33 34 34 thread T {}; 35 void ^?{}( T & mutex this) {}36 void main( T & this) {35 void ^?{}( T & mutex ) {} 36 void main( T & ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1); } … … 40 40 } 41 41 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 45 43 T t; 46 44 return wait(m1); -
benchmark/schedint/cfa2.cfa
r8d61d620 rf2f22e3 21 21 go = 1; 22 22 BENCH( 23 for ( size_t i = 0; i < n; i++) {23 for ( i; n ) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% llu\n", result);29 printf("%g\n", result); 30 30 go = 0; 31 31 return 0; … … 34 34 thread T {}; 35 35 void ^?{}( T & mutex this ) {} 36 void main( T & this) {36 void main( T & ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1, m2); } … … 40 40 } 41 41 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 45 43 T t; 46 44 return wait(m1, m2); -
benchmark/schedint/cfa4.cfa
r8d61d620 rf2f22e3 21 21 go = 1; 22 22 BENCH( 23 for ( size_t i = 0; i < n; i++) {23 for ( i; n ) { 24 24 wait(c); 25 25 }, … … 27 27 ) 28 28 29 printf("% llu\n", result);29 printf("%g\n", result); 30 30 go = 0; 31 31 return 0; … … 34 34 thread T {}; 35 35 void ^?{}( T & mutex this ) {} 36 void main( T & this) {36 void main( T & ) { 37 37 while(go == 0) { yield(); } 38 38 while(go == 1) { call(m1, m2, m3, m4); } … … 40 40 } 41 41 42 int main(int margc, char* margv[]) { 43 argc = margc; 44 argv = margv; 42 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 45 43 T t; 46 44 return wait(m1, m2, m3, m4); -
benchmark/schedint/pthreads.c
r8d61d620 rf2f22e3 27 27 ) 28 28 29 printf("% llu\n", result);29 printf("%g\n", result); 30 30 go = 0; 31 31 pthread_mutex_unlock(&m); … … 33 33 } 34 34 35 void* thread_main( void * a) {35 void* thread_main(__attribute__((unused)) void * arg ) { 36 36 while(go == 0) { sched_yield(); } 37 37 while(go == 1) { call(); } … … 39 39 } 40 40 41 int main(int margc, char* margv[]) { 42 argc = margc; 43 argv = margv; 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 44 42 pthread_t thread; 45 43 if (pthread_create(&thread, NULL, thread_main, NULL) < 0) { -
benchmark/schedint/upp.cc
r8d61d620 rf2f22e3 23 23 ) 24 24 25 printf("% llu\n", result);25 printf("%g\n", result); 26 26 go = 0; 27 27 return 0; … … 39 39 }; 40 40 41 int main(int margc, char* margv[]) { 42 argc = margc; 43 argv = margv; 41 int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) { 44 42 T t; 45 43 return m.wait(); -
benchmark/tls-fetch_add.c
r8d61d620 rf2f22e3 24 24 ) 25 25 26 printf("% llu\n", result);26 printf("%g\n", result); 27 27 } -
libcfa/src/concurrency/coroutine.hfa
r8d61d620 rf2f22e3 10 10 // Created On : Mon Nov 28 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 30 18:23:45 201813 // Update Count : 812 // Last Modified On : Fri Jun 21 17:49:39 2019 13 // Update Count : 9 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; } 55 57 56 58 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/invoke.h
r8d61d620 rf2f22e3 10 10 // Created On : Tue Jan 17 12:27:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat May 19 08:23:21 201813 // Update Count : 3112 // Last Modified On : Sat Jun 22 18:19:13 2019 13 // Update Count : 40 14 14 // 15 15 … … 46 46 #ifdef __cforall 47 47 extern "Cforall" { 48 static inline struct thread_desc * 49 static inline struct __condition_criterion_t * 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 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 ) { 201 static inline thread_desc *& get_next( thread_desc & this ) { 206 202 return this.next; 207 203 } … … 210 206 return this.node.[next, prev]; 211 207 } 212 213 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );214 208 215 209 static inline void ?{}(__monitor_group_t & this) { -
libcfa/src/concurrency/kernel.cfa
r8d61d620 rf2f22e3 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 9 16:11:46 201813 // Update Count : 2 412 // Last Modified On : Thu Jun 20 17:21:23 2019 13 // Update Count : 25 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; 909 910 push_front(cltr->threads, thrd); 910 911 unlock (cltr->thread_list_lock); … … 914 915 lock (cltr->thread_list_lock __cfaabi_dbg_ctx2); 915 916 remove(cltr->threads, thrd ); 917 cltr->nthreads -= 1; 916 918 unlock(cltr->thread_list_lock); 917 919 } … … 919 921 void doregister( cluster * cltr, processor * proc ) { 920 922 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 923 cltr->nprocessors += 1; 921 924 push_front(cltr->procs, *proc); 922 925 unlock (cltr->proc_list_lock); … … 926 929 lock (cltr->proc_list_lock __cfaabi_dbg_ctx2); 927 930 remove(cltr->procs, *proc ); 931 cltr->nprocessors -= 1; 928 932 unlock(cltr->proc_list_lock); 929 933 } -
libcfa/src/concurrency/kernel.hfa
r8d61d620 rf2f22e3 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Apr 10 14:46:49 201813 // Update Count : 1 012 // Last Modified On : Sat Jun 22 11:39:17 2019 13 // Update Count : 16 14 14 // 15 15 … … 91 91 this.lock = NULL; 92 92 } 93 static inline void ^?{}(FinishAction & this) {}93 static inline void ^?{}(FinishAction &) {} 94 94 95 95 // Processor … … 176 176 __dllist_t(struct processor) procs; 177 177 __dllist_t(struct processor) idles; 178 179 // List of processors 178 unsigned int nprocessors; 179 180 // List of threads 180 181 __spinlock_t thread_list_lock; 181 182 __dllist_t(struct thread_desc) threads; 183 unsigned int nthreads; 182 184 183 185 // Link lists fields … … 200 202 } 201 203 204 static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE 205 static inline struct cluster * active_cluster () { return TL_GET( this_processor )->cltr; } 206 202 207 // Local Variables: // 203 208 // mode: c // -
libcfa/src/concurrency/thread.hfa
r8d61d620 rf2f22e3 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Mar 29 14:07:11 201813 // Update Count : 412 // Last Modified On : Fri Jun 21 17:51:33 2019 13 // Update Count : 5 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 93 95 // Local Variables: // 94 96 // mode: c // -
src/ResolvExpr/Cost.h
r8d61d620 rf2f22e3 10 10 // Created On : Sun May 17 09:39:50 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Apr 29 18:33:44201913 // Update Count : 4912 // Last Modified On : Fri Jun 21 11:39:13 2019 13 // Update Count : 63 14 14 // 15 15 … … 21 21 22 22 namespace ResolvExpr { 23 #if 024 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 > other55 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) conversions70 int polyCost; ///< Count of parameters and return values bound to some poly type71 int safeCost; ///< Safe (widening) conversions72 int signCost; ///< Count of safe sign conversions73 int varCost; ///< Count of polymorphic type variables74 int specCost; ///< Polymorphic type specializations (type assertions), negative cost75 int referenceCost; ///< reference conversions76 };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 } // if184 }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.unsafeCost201 && polyCost == other.polyCost202 && safeCost == other.safeCost203 && signCost == other.signCost204 && varCost == other.varCost205 && specCost == other.specCost206 && 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 #else221 222 //*************************** NEW ***************************223 224 23 // To maximize performance and space, the 7 resolution costs are packed into a single 64-bit word. However, the 225 24 // specialization cost is a negative value so a correction is needed is a few places. … … 371 170 << ", " << cost.get_referenceCost() << " )"; 372 171 } 373 #endif // 0374 172 } // namespace ResolvExpr 375 173 -
tests/concurrent/examples/boundedBufferTHREAD.cfa
r8d61d620 rf2f22e3 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // boundedBuffer EXT.c --7 // boundedBufferTHREAD.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 08:15:58201913 // Update Count : 2 312 // Last Modified On : Fri Jun 21 11:50:12 2019 13 // Update Count : 24 14 14 // 15 15 -
tools/stat.py
r8d61d620 rf2f22e3 11 11 content = f.readlines() 12 12 content = [x.strip() for x in content] 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 )13 content = [float(x) for x in content] # expect floating-point strings 14 content.remove(max(content)) # need at least 4 data values because 15 content.remove(min(content)) # the max and min values are removed 16 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 ) 20 20 21 21
Note:
See TracChangeset
for help on using the changeset viewer.