Changes in / [8d61d620:f2f22e3]


Ignore:
Files:
4 added
43 edited

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    r8d61d620 rf2f22e3  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Tue Nov  6 09:01:23 2018
    14 ## Update Count     : 26
     13## Last Modified On : Sun Jun 23 12:34:29 2019
     14## Update Count     : 52
    1515###############################################################################
    1616
     
    2121include $(top_srcdir)/src/cfa.make
    2222
    23 AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread
     23AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
    2424AM_CFAFLAGS = -quiet -nodebug -in-tree
    2525AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
     
    3131BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
    3232BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
     33BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))
    3334
    3435__quiet = verbose
     
    4546__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    4647__bench_v_UPP_verbose = $(AM_V_UPP)
    47 
     48__bench_v_QTHREAD_verbose = $(AM_V_CC)
    4849
    4950
     
    5152REPEAT   = ${abs_top_builddir}/tools/repeat
    5253STATS    = ${abs_top_srcdir}/tools/stat.py
    53 repeats  = 30
     54repeats  = 3 # 30
    5455skipcompile = no
    5556TIME_FORMAT = "%E"
     
    124125
    125126ctxswitch.csv:
    126         @echo "coroutine,thread" > $@
     127        @echo "generator,coroutine,thread" > $@
     128        @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
    127129        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    128130        @+make ctxswitch-cfa_thread.runquiet >> $@
     
    153155        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    154156
     157ttst_lock$(EXEEXT):
     158        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
     159
    155160tls-fetch_add$(EXEEXT):
    156161        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
     
    161166        function.run                    \
    162167        fetch_add.run                   \
     168        ttst_lock.run                   \
    163169        tls-fetch_add.run                       \
    164170        ctxswitch-pthread.run           \
     171        ctxswitch-cfa_generator.run     \
    165172        ctxswitch-cfa_coroutine.run     \
    166173        ctxswitch-cfa_thread.run        \
     
    169176        ctxswitch-upp_thread.run        \
    170177        ctxswitch-goroutine.run         \
    171         ctxswitch-java_thread.run
     178        ctxswitch-java_thread.run       \
     179        ctxswitch-qthreads.run
     180
    172181
    173182if WITH_LIBFIBRE
     
    188197ctxswitch-pthread$(EXEEXT):
    189198        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
     199
     200ctxswitch-cfa_generator$(EXEEXT):
     201        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
    190202
    191203ctxswitch-cfa_coroutine$(EXEEXT):
     
    212224        @echo "java JavaThread" >> a.out
    213225        @chmod a+x a.out
     226
     227ctxswitch-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
    214229
    215230## =========================================================================================================
     
    305320        creation-upp_thread.run                 \
    306321        creation-goroutine.run                  \
    307         creation-java_thread.run
     322        creation-java_thread.run                \
     323        creation-qthreads.run
    308324
    309325creation-cfa_coroutine$(EXEEXT):
     
    333349        @echo "java JavaThread" >> a.out
    334350        @chmod a+x a.out
     351
     352creation-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
    335354
    336355## =========================================================================================================
     
    375394compile-typeof$(EXEEXT):
    376395        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
    377 
  • benchmark/Makefile.in

    r8d61d620 rf2f22e3  
    363363am__v_GOC_0 = @echo "  GOC     " $@;
    364364am__v_GOC_1 =
    365 UPPCC = u++
     365UPPCC = u++-work
    366366UPPCOMPILE = $(UPPCC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_UPPFLAGS) $(UPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_CFLAGS) $(CFLAGS)
    367367AM_V_UPP = $(am__v_UPP_@AM_V@)
     
    371371
    372372# applies to both programs
    373 AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread
     373AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
    374374AM_CFAFLAGS = -quiet -nodebug -in-tree
    375375AM_UPPFLAGS = -quiet -nodebug -multi -std=c++14
     
    380380BENCH_V_JAVAC = $(__bench_v_JAVAC_$(__quiet))
    381381BENCH_V_UPP = $(__bench_v_UPP_$(__quiet))
     382BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))
    382383__quiet = verbose
    383384__bench_v_CC_quiet = @
     
    393394__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    394395__bench_v_UPP_verbose = $(AM_V_UPP)
     396__bench_v_QTHREAD_verbose = $(AM_V_CC)
    395397TOOLSDIR = ${abs_top_builddir}/tools/
    396398REPEAT = ${abs_top_builddir}/tools/repeat
    397399STATS = ${abs_top_srcdir}/tools/stat.py
    398 repeats = 30
     400repeats = 3 # 30
    399401skipcompile = no
    400402TIME_FORMAT = "%E"
     
    402404dummy_SOURCES = dummyC.c dummyCXX.cpp
    403405FIX_NEW_LINES = cat $@ | tr "\n" "\t" | sed -r 's/\t,/,/' | tr "\t" "\n" > $@
    404 CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \
     406CTXSWITCH_DEPEND = loop.run function.run fetch_add.run ttst_lock.run \
    405407        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)
    410413testdir = $(top_srcdir)/tests
    411414all: all-am
     
    784787
    785788ctxswitch.csv:
    786         @echo "coroutine,thread" > $@
     789        @echo "generator,coroutine,thread" > $@
     790        @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
    787791        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    788792        @+make ctxswitch-cfa_thread.runquiet >> $@
     
    812816        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    813817
     818ttst_lock$(EXEEXT):
     819        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
     820
    814821tls-fetch_add$(EXEEXT):
    815822        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
     
    825832ctxswitch-pthread$(EXEEXT):
    826833        $(BENCH_V_CC)$(COMPILE)    -DBENCH_N=50000000 $(srcdir)/ctxswitch/pthreads.c
     834
     835ctxswitch-cfa_generator$(EXEEXT):
     836        $(BENCH_V_CFA)$(CFACOMPILE) -DBENCH_N=50000000 $(srcdir)/ctxswitch/cfa_gen.cfa
    827837
    828838ctxswitch-cfa_coroutine$(EXEEXT):
     
    849859        @echo "java JavaThread" >> a.out
    850860        @chmod a+x a.out
     861
     862ctxswitch-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
    851864
    852865mutex$(EXEEXT) :\
     
    937950        creation-upp_thread.run                 \
    938951        creation-goroutine.run                  \
    939         creation-java_thread.run
     952        creation-java_thread.run                \
     953        creation-qthreads.run
    940954
    941955creation-cfa_coroutine$(EXEEXT):
     
    965979        @echo "java JavaThread" >> a.out
    966980        @chmod a+x a.out
     981
     982creation-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
    967984
    968985compile$(EXEEXT) :\
  • benchmark/bench.h

    r8d61d620 rf2f22e3  
    4545        statement;                                      \
    4646        EndTime = bench_time();                 \
    47         unsigned long long int output =         \
    48         ( EndTime - StartTime ) / n;
     47        double output =         \
     48            (double)( EndTime - StartTime ) / n;
    4949
    5050#if defined(__cforall)
  • benchmark/creation/cfa_cor.cfa

    r8d61d620 rf2f22e3  
    1010#endif
    1111}
    12 void main(MyCoroutine & this) {}
     12void main(MyCoroutine &) {}
    1313
    1414int main(int argc, char* argv[]) {
    1515        BENCH(
    16                 for (size_t i = 0; i < n; i++) {
     16                for ( i; n ) {
    1717                        MyCoroutine m;
    1818                },
     
    2020        )
    2121
    22         printf("%llu\n", result);
     22        printf("%g\n", result);
    2323}
  • benchmark/creation/cfa_thrd.cfa

    r8d61d620 rf2f22e3  
    55
    66thread MyThread {};
    7 void main(MyThread & this) {}
     7void main(MyThread &) {}
    88
    99int main(int argc, char* argv[]) {
    1010        BENCH(
    11                 for (size_t i = 0; i < n; i++) {
     11                for ( i; n ) {
    1212                        MyThread m;
    1313                },
     
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/creation/pthreads.c

    r8d61d620 rf2f22e3  
    2525        )
    2626
    27         printf("%llu\n", result);
     27        printf("%g\n", result);
    2828}
  • benchmark/creation/upp_cor.cc

    r8d61d620 rf2f22e3  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/creation/upp_thrd.cc

    r8d61d620 rf2f22e3  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/ctxswitch/cfa_cor.cfa

    r8d61d620 rf2f22e3  
    1 #include <stdio.h>
    21#include <kernel.hfa>
    32#include <thread.hfa>
     
    2120
    2221        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     22                for ( i; n ) {
    2423                        resume( s );
    2524                },
     
    2726        )
    2827
    29         printf("%llu\n", result);
     28        printf("%g\n", result);
    3029}
  • benchmark/ctxswitch/cfa_cor_then.cfa

    r8d61d620 rf2f22e3  
    1 #include <stdio.h>
    21#include <kernel.hfa>
    32#include <thread.hfa>
     
    2322
    2423        BENCH(
    25                 for (size_t i = 0; i < n; i++) {
     24                for ( i; n ) {
    2625                        resume( s );
    2726                },
     
    2928        )
    3029
    31         printf("%llu\n", result);
     30        printf("%g\n", result);
    3231}
  • benchmark/ctxswitch/cfa_thrd.cfa

    r8d61d620 rf2f22e3  
    1 #include <stdio.h>
    21#include <thread.hfa>
    32
     
    65int main(int argc, char* argv[]) {
    76        BENCH(
    8                 for (size_t i = 0; i < n; i++) {
     7                for ( i; n ) {
    98                        yield();
    109                },
     
    1211        )
    1312
    14         printf("%llu\n", result);
     13        printf("%g\n", result);
    1514}
  • benchmark/ctxswitch/cfa_thrd2.cfa

    r8d61d620 rf2f22e3  
    1 #include <stdio.h>
    21#include <thread.hfa>
    32
     
    1716        Fibre f1;
    1817        BENCH(
    19                 for (size_t i = 0; i < n; i++) {
     18                for ( i; n ) {
    2019                        yield();
    2120                },
     
    2322        )
    2423
    25         printf("%llu\n", result);
     24        printf("%g\n", result);
    2625        done = true;
    2726        return 0;
  • benchmark/ctxswitch/kos_fibre.cpp

    r8d61d620 rf2f22e3  
    1010                result
    1111        )
    12         printf("%llu\n", result);
     12        printf("%g\n", result);
    1313        return 0;
    1414}
  • benchmark/ctxswitch/kos_fibre2.cpp

    r8d61d620 rf2f22e3  
    1919                result
    2020        )
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222        done = true;
    2323        Fibre::yield();
  • benchmark/ctxswitch/pthreads.c

    r8d61d620 rf2f22e3  
    1414        )
    1515
    16         printf("%llu\n", result);
     16        printf("%g\n", result);
    1717}
  • benchmark/ctxswitch/upp_cor.cc

    r8d61d620 rf2f22e3  
    3030        )
    3131
    32         printf("%llu\n", result);
     32        printf("%g\n", result);
    3333}
  • benchmark/ctxswitch/upp_thrd.cc

    r8d61d620 rf2f22e3  
    1111        )
    1212
    13         printf("%llu\n", result);
     13        printf("%g\n", result);
    1414}
  • benchmark/fetch_add.c

    r8d61d620 rf2f22e3  
    1919        )
    2020
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222}
  • benchmark/function.c

    r8d61d620 rf2f22e3  
    1515        )
    1616
    17         printf("%llu\n", result);
     17        printf("%g\n", result);
    1818}
  • benchmark/loop.c

    r8d61d620 rf2f22e3  
    1111        )
    1212
    13         printf("%llu\n", result);
     13        printf("%g\n", result);
    1414}
  • benchmark/mutex/cfa1.cfa

    r8d61d620 rf2f22e3  
    1010        M m;
    1111        BENCH(
    12                 for (size_t i = 0; i < n; i++) {
     12                for ( i; n ) {
    1313                        call(m);
    1414                },
     
    1616        )
    1717
    18         printf("%llu\n", result);
     18        printf("%g\n", result);
    1919}
  • benchmark/mutex/cfa2.cfa

    r8d61d620 rf2f22e3  
    1010        M m1, m2;
    1111        BENCH(
    12                 for (size_t i = 0; i < n; i++) {
     12                for ( i; n ) {
    1313                        call(m1, m2);
    1414                },
     
    1616        )
    1717
    18         printf("%llu\n", result);
     18        printf("%g\n", result);
    1919}
  • benchmark/mutex/cfa4.cfa

    r8d61d620 rf2f22e3  
    1111        M m1, m2, m3, m4;
    1212        BENCH(
    13                 for (size_t i = 0; i < n; i++) {
     13                for ( i; n ) {
    1414                        call(m1, m2, m3, m4);
    1515                },
     
    1717        )
    1818
    19         printf("%llu\n", result);
     19        printf("%g\n", result);
    2020}
  • benchmark/mutex/pthreads.c

    r8d61d620 rf2f22e3  
    1919        )
    2020
    21         printf("%llu\n", result);
     21        printf("%g\n", result);
    2222}
  • benchmark/mutex/upp.cc

    r8d61d620 rf2f22e3  
    1717        )
    1818
    19         printf("%llu\n", result);
     19        printf("%g\n", result);
    2020}
  • benchmark/schedext/cfa1.cfa

    r8d61d620 rf2f22e3  
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1);
  • benchmark/schedext/cfa2.cfa

    r8d61d620 rf2f22e3  
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1, a2);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1, m2); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1, m2);
  • benchmark/schedext/cfa4.cfa

    r8d61d620 rf2f22e3  
    1818        go = 1;
    1919        BENCH(
    20                 for (size_t i = 0; i < n; i++) {
     20                for ( i; n ) {
    2121                        waitfor(call, a1, a2, a3, a4);
    2222                },
     
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727        go = 0;
    2828        return 0;
     
    3131thread T {};
    3232void ^?{}( T & mutex this ) {}
    33 void main( T & this ) {
     33void main( T & ) {
    3434        while(go == 0) { yield(); }
    3535        while(go == 1) { call(m1, m2, m3, m4); }
     
    3737}
    3838
    39 int main(int margc, char* margv[]) {
    40         argc = margc;
    41         argv = margv;
     39int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4240        T t;
    4341        return wait(m1, m2, m3, m4);
  • benchmark/schedext/upp.cc

    r8d61d620 rf2f22e3  
    2020                )
    2121
    22                 printf("%llu\n", result);
     22                printf("%g\n", result);
    2323                go = 0;
    2424                return 0;
  • benchmark/schedint/cfa1.cfa

    r8d61d620 rf2f22e3  
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3333
    3434thread T {};
    35 void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     35void ^?{}( T & mutex ) {}
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1);
  • benchmark/schedint/cfa2.cfa

    r8d61d620 rf2f22e3  
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3434thread T {};
    3535void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1, m2); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1, m2);
  • benchmark/schedint/cfa4.cfa

    r8d61d620 rf2f22e3  
    2121        go = 1;
    2222        BENCH(
    23                 for (size_t i = 0; i < n; i++) {
     23                for ( i; n ) {
    2424                        wait(c);
    2525                },
     
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        return 0;
     
    3434thread T {};
    3535void ^?{}( T & mutex this ) {}
    36 void main( T & this ) {
     36void main( T & ) {
    3737        while(go == 0) { yield(); }
    3838        while(go == 1) { call(m1, m2, m3, m4); }
     
    4040}
    4141
    42 int main(int margc, char* margv[]) {
    43         argc = margc;
    44         argv = margv;
     42int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4543        T t;
    4644        return wait(m1, m2, m3, m4);
  • benchmark/schedint/pthreads.c

    r8d61d620 rf2f22e3  
    2727        )
    2828
    29         printf("%llu\n", result);
     29        printf("%g\n", result);
    3030        go = 0;
    3131        pthread_mutex_unlock(&m);
     
    3333}
    3434
    35 void* thread_main(void * a) {
     35void* thread_main(__attribute__((unused)) void * arg ) {
    3636        while(go == 0) { sched_yield(); }
    3737        while(go == 1) { call(); }
     
    3939}
    4040
    41 int main(int margc, char* margv[]) {
    42         argc = margc;
    43         argv = margv;
     41int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4442        pthread_t thread;
    4543        if (pthread_create(&thread, NULL, thread_main, NULL) < 0) {
  • benchmark/schedint/upp.cc

    r8d61d620 rf2f22e3  
    2323                )
    2424
    25                 printf("%llu\n", result);
     25                printf("%g\n", result);
    2626                go = 0;
    2727                return 0;
     
    3939};
    4040
    41 int main(int margc, char* margv[]) {
    42         argc = margc;
    43         argv = margv;
     41int main(__attribute__((unused)) int argc, __attribute__((unused)) char* argv[]) {
    4442        T t;
    4543        return m.wait();
  • benchmark/tls-fetch_add.c

    r8d61d620 rf2f22e3  
    2424        )
    2525
    26         printf("%llu\n", result);
     26        printf("%g\n", result);
    2727}
  • libcfa/src/concurrency/coroutine.hfa

    r8d61d620 rf2f22e3  
    1010// Created On       : Mon Nov 28 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar 30 18:23:45 2018
    13 // Update Count     : 8
     12// Last Modified On : Fri Jun 21 17:49:39 2019
     13// Update Count     : 9
    1414//
    1515
     
    5353forall(dtype T | is_coroutine(T))
    5454void prime(T & cor);
     55
     56static inline struct coroutine_desc * active_coroutine() { return TL_GET( this_thread )->curr_cor; }
    5557
    5658//-----------------------------------------------------------------------------
  • libcfa/src/concurrency/invoke.h

    r8d61d620 rf2f22e3  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat May 19 08:23:21 2018
    13 // Update Count     : 31
     12// Last Modified On : Sat Jun 22 18:19:13 2019
     13// Update Count     : 40
    1414//
    1515
     
    4646        #ifdef __cforall
    4747        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 );
    5050
    5151                extern thread_local struct KernelThreadData {
     
    199199        #ifdef __cforall
    200200        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 ) {
    206202                        return this.next;
    207203                }
     
    210206                        return this.node.[next, prev];
    211207                }
    212 
    213                 static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );
    214208
    215209                static inline void ?{}(__monitor_group_t & this) {
  • libcfa/src/concurrency/kernel.cfa

    r8d61d620 rf2f22e3  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr  9 16:11:46 2018
    13 // Update Count     : 24
     12// Last Modified On : Thu Jun 20 17:21:23 2019
     13// Update Count     : 25
    1414//
    1515
     
    907907void doregister( cluster * cltr, thread_desc & thrd ) {
    908908        lock      (cltr->thread_list_lock __cfaabi_dbg_ctx2);
     909        cltr->nthreads += 1;
    909910        push_front(cltr->threads, thrd);
    910911        unlock    (cltr->thread_list_lock);
     
    914915        lock  (cltr->thread_list_lock __cfaabi_dbg_ctx2);
    915916        remove(cltr->threads, thrd );
     917        cltr->nthreads -= 1;
    916918        unlock(cltr->thread_list_lock);
    917919}
     
    919921void doregister( cluster * cltr, processor * proc ) {
    920922        lock      (cltr->proc_list_lock __cfaabi_dbg_ctx2);
     923        cltr->nprocessors += 1;
    921924        push_front(cltr->procs, *proc);
    922925        unlock    (cltr->proc_list_lock);
     
    926929        lock  (cltr->proc_list_lock __cfaabi_dbg_ctx2);
    927930        remove(cltr->procs, *proc );
     931        cltr->nprocessors -= 1;
    928932        unlock(cltr->proc_list_lock);
    929933}
  • libcfa/src/concurrency/kernel.hfa

    r8d61d620 rf2f22e3  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Apr 10 14:46:49 2018
    13 // Update Count     : 10
     12// Last Modified On : Sat Jun 22 11:39:17 2019
     13// Update Count     : 16
    1414//
    1515
     
    9191        this.lock = NULL;
    9292}
    93 static inline void ^?{}(FinishAction & this) {}
     93static inline void ^?{}(FinishAction &) {}
    9494
    9595// Processor
     
    176176        __dllist_t(struct processor) procs;
    177177        __dllist_t(struct processor) idles;
    178 
    179         // List of processors
     178        unsigned int nprocessors;
     179
     180        // List of threads
    180181        __spinlock_t thread_list_lock;
    181182        __dllist_t(struct thread_desc) threads;
     183        unsigned int nthreads;
    182184
    183185        // Link lists fields
     
    200202}
    201203
     204static inline struct processor * active_processor() { return TL_GET( this_processor ); } // UNSAFE
     205static inline struct cluster   * active_cluster  () { return TL_GET( this_processor )->cltr; }
     206
    202207// Local Variables: //
    203208// mode: c //
  • libcfa/src/concurrency/thread.hfa

    r8d61d620 rf2f22e3  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Mar 29 14:07:11 2018
    13 // Update Count     : 4
     12// Last Modified On : Fri Jun 21 17:51:33 2019
     13// Update Count     : 5
    1414//
    1515
     
    9191void yield( unsigned times );
    9292
     93static inline struct thread_desc * active_thread () { return TL_GET( this_thread ); }
     94
    9395// Local Variables: //
    9496// mode: c //
  • src/ResolvExpr/Cost.h

    r8d61d620 rf2f22e3  
    1010// Created On       : Sun May 17 09:39:50 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 29 18:33:44 2019
    13 // Update Count     : 49
     12// Last Modified On : Fri Jun 21 11:39:13 2019
     13// Update Count     : 63
    1414//
    1515
     
    2121
    2222namespace 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 
    22423        // To maximize performance and space, the 7 resolution costs are packed into a single 64-bit word. However, the
    22524        // specialization cost is a negative value so a correction is needed is a few places.
     
    371170                                  << ", " << cost.get_referenceCost() << " )";
    372171        }
    373 #endif // 0
    374172} // namespace ResolvExpr
    375173
  • tests/concurrent/examples/boundedBufferTHREAD.cfa

    r8d61d620 rf2f22e3  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // boundedBufferEXT.c --
     7// boundedBufferTHREAD.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Apr 18 22:52:12 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun 21 08:15:58 2019
    13 // Update Count     : 23
     12// Last Modified On : Fri Jun 21 11:50:12 2019
     13// Update Count     : 24
    1414//
    1515
  • tools/stat.py

    r8d61d620 rf2f22e3  
    1111                content = f.readlines()
    1212                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 )
    2020
    2121
Note: See TracChangeset for help on using the changeset viewer.