Changes in / [f2f22e3:8d61d620]


Ignore:
Files:
4 deleted
43 edited

Legend:

Unmodified
Added
Removed
  • benchmark/Makefile.am

    rf2f22e3 r8d61d620  
    1111## Created On       : Sun May 31 09:08:15 2015
    1212## Last Modified By : Peter A. Buhr
    13 ## Last Modified On : Sun Jun 23 12:34:29 2019
    14 ## Update Count     : 52
     13## Last Modified On : Tue Nov  6 09:01:23 2018
     14## Update Count     : 26
    1515###############################################################################
    1616
     
    2121include $(top_srcdir)/src/cfa.make
    2222
    23 AM_CFLAGS = -O2 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror
     23AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread
    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))
    33 BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))
    3433
    3534__quiet = verbose
     
    4645__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    4746__bench_v_UPP_verbose = $(AM_V_UPP)
    48 __bench_v_QTHREAD_verbose = $(AM_V_CC)
     47
    4948
    5049
     
    5251REPEAT   = ${abs_top_builddir}/tools/repeat
    5352STATS    = ${abs_top_srcdir}/tools/stat.py
    54 repeats  = 3 # 30
     53repeats  = 30
    5554skipcompile = no
    5655TIME_FORMAT = "%E"
     
    125124
    126125ctxswitch.csv:
    127         @echo "generator,coroutine,thread" > $@
    128         @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
     126        @echo "coroutine,thread" > $@
    129127        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    130128        @+make ctxswitch-cfa_thread.runquiet >> $@
     
    155153        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    156154
    157 ttst_lock$(EXEEXT):
    158         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
    159 
    160155tls-fetch_add$(EXEEXT):
    161156        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
     
    166161        function.run                    \
    167162        fetch_add.run                   \
    168         ttst_lock.run                   \
    169163        tls-fetch_add.run                       \
    170164        ctxswitch-pthread.run           \
    171         ctxswitch-cfa_generator.run     \
    172165        ctxswitch-cfa_coroutine.run     \
    173166        ctxswitch-cfa_thread.run        \
     
    176169        ctxswitch-upp_thread.run        \
    177170        ctxswitch-goroutine.run         \
    178         ctxswitch-java_thread.run       \
    179         ctxswitch-qthreads.run
    180 
     171        ctxswitch-java_thread.run
    181172
    182173if WITH_LIBFIBRE
     
    197188ctxswitch-pthread$(EXEEXT):
    198189        $(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
    202190
    203191ctxswitch-cfa_coroutine$(EXEEXT):
     
    224212        @echo "java JavaThread" >> a.out
    225213        @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
    229214
    230215## =========================================================================================================
     
    320305        creation-upp_thread.run                 \
    321306        creation-goroutine.run                  \
    322         creation-java_thread.run                \
    323         creation-qthreads.run
     307        creation-java_thread.run
    324308
    325309creation-cfa_coroutine$(EXEEXT):
     
    349333        @echo "java JavaThread" >> a.out
    350334        @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
    354335
    355336## =========================================================================================================
     
    394375compile-typeof$(EXEEXT):
    395376        @$(CFACOMPILE) -fsyntax-only -w $(testdir)/typeof.cfa
     377
  • benchmark/Makefile.in

    rf2f22e3 r8d61d620  
    363363am__v_GOC_0 = @echo "  GOC     " $@;
    364364am__v_GOC_1 =
    365 UPPCC = u++-work
     365UPPCC = u++
    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 -I$(srcdir) -lrt -pthread # -Werror
     373AM_CFLAGS = -O2 -Wall -Wextra -Werror -I$(srcdir) -lrt -pthread
    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))
    382 BENCH_V_QTHREAD = $(__bench_v_QTHREAD_$(__quiet))
    383382__quiet = verbose
    384383__bench_v_CC_quiet = @
     
    394393__bench_v_JAVAC_verbose = $(AM_V_JAVAC)
    395394__bench_v_UPP_verbose = $(AM_V_UPP)
    396 __bench_v_QTHREAD_verbose = $(AM_V_CC)
    397395TOOLSDIR = ${abs_top_builddir}/tools/
    398396REPEAT = ${abs_top_builddir}/tools/repeat
    399397STATS = ${abs_top_srcdir}/tools/stat.py
    400 repeats = 3 # 30
     398repeats = 30
    401399skipcompile = no
    402400TIME_FORMAT = "%E"
     
    404402dummy_SOURCES = dummyC.c dummyCXX.cpp
    405403FIX_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 \
     404CTXSWITCH_DEPEND = loop.run function.run fetch_add.run \
    407405        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)
    413410testdir = $(top_srcdir)/tests
    414411all: all-am
     
    787784
    788785ctxswitch.csv:
    789         @echo "generator,coroutine,thread" > $@
    790         @+make ctxswitch-cfa_generator.runquiet >> $@ && echo -n ',' >> $@
     786        @echo "coroutine,thread" > $@
    791787        @+make ctxswitch-cfa_coroutine.runquiet >> $@ && echo -n ',' >> $@
    792788        @+make ctxswitch-cfa_thread.runquiet >> $@
     
    816812        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/fetch_add.c
    817813
    818 ttst_lock$(EXEEXT):
    819         $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/ttst_lock.c
    820 
    821814tls-fetch_add$(EXEEXT):
    822815        $(BENCH_V_CC)$(COMPILE) -DBENCH_N=500000000  $(srcdir)/tls-fetch_add.c
     
    832825ctxswitch-pthread$(EXEEXT):
    833826        $(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
    837827
    838828ctxswitch-cfa_coroutine$(EXEEXT):
     
    859849        @echo "java JavaThread" >> a.out
    860850        @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
    864851
    865852mutex$(EXEEXT) :\
     
    950937        creation-upp_thread.run                 \
    951938        creation-goroutine.run                  \
    952         creation-java_thread.run                \
    953         creation-qthreads.run
     939        creation-java_thread.run
    954940
    955941creation-cfa_coroutine$(EXEEXT):
     
    979965        @echo "java JavaThread" >> a.out
    980966        @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
    984967
    985968compile$(EXEEXT) :\
  • benchmark/bench.h

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

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

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

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

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

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

    rf2f22e3 r8d61d620  
     1#include <stdio.h>
    12#include <kernel.hfa>
    23#include <thread.hfa>
     
    2021
    2122        BENCH(
    22                 for ( i; n ) {
     23                for (size_t i = 0; i < n; i++) {
    2324                        resume( s );
    2425                },
     
    2627        )
    2728
    28         printf("%g\n", result);
     29        printf("%llu\n", result);
    2930}
  • benchmark/ctxswitch/cfa_cor_then.cfa

    rf2f22e3 r8d61d620  
     1#include <stdio.h>
    12#include <kernel.hfa>
    23#include <thread.hfa>
     
    2223
    2324        BENCH(
    24                 for ( i; n ) {
     25                for (size_t i = 0; i < n; i++) {
    2526                        resume( s );
    2627                },
     
    2829        )
    2930
    30         printf("%g\n", result);
     31        printf("%llu\n", result);
    3132}
  • benchmark/ctxswitch/cfa_thrd.cfa

    rf2f22e3 r8d61d620  
     1#include <stdio.h>
    12#include <thread.hfa>
    23
     
    56int main(int argc, char* argv[]) {
    67        BENCH(
    7                 for ( i; n ) {
     8                for (size_t i = 0; i < n; i++) {
    89                        yield();
    910                },
     
    1112        )
    1213
    13         printf("%g\n", result);
     14        printf("%llu\n", result);
    1415}
  • benchmark/ctxswitch/cfa_thrd2.cfa

    rf2f22e3 r8d61d620  
     1#include <stdio.h>
    12#include <thread.hfa>
    23
     
    1617        Fibre f1;
    1718        BENCH(
    18                 for ( i; n ) {
     19                for (size_t i = 0; i < n; i++) {
    1920                        yield();
    2021                },
     
    2223        )
    2324
    24         printf("%g\n", result);
     25        printf("%llu\n", result);
    2526        done = true;
    2627        return 0;
  • benchmark/ctxswitch/kos_fibre.cpp

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    rf2f22e3 r8d61d620  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 22 18:19:13 2019
    13 // Update Count     : 40
     12// Last Modified On : Sat May 19 08:23:21 2018
     13// Update Count     : 31
    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 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 ) {
    202206                        return this.next;
    203207                }
     
    206210                        return this.node.[next, prev];
    207211                }
     212
     213                static inline struct __condition_criterion_t * & get_next( struct __condition_criterion_t & this );
    208214
    209215                static inline void ?{}(__monitor_group_t & this) {
  • libcfa/src/concurrency/kernel.cfa

    rf2f22e3 r8d61d620  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun 20 17:21:23 2019
    13 // Update Count     : 25
     12// Last Modified On : Mon Apr  9 16:11:46 2018
     13// Update Count     : 24
    1414//
    1515
     
    907907void doregister( cluster * cltr, thread_desc & thrd ) {
    908908        lock      (cltr->thread_list_lock __cfaabi_dbg_ctx2);
    909         cltr->nthreads += 1;
    910909        push_front(cltr->threads, thrd);
    911910        unlock    (cltr->thread_list_lock);
     
    915914        lock  (cltr->thread_list_lock __cfaabi_dbg_ctx2);
    916915        remove(cltr->threads, thrd );
    917         cltr->nthreads -= 1;
    918916        unlock(cltr->thread_list_lock);
    919917}
     
    921919void doregister( cluster * cltr, processor * proc ) {
    922920        lock      (cltr->proc_list_lock __cfaabi_dbg_ctx2);
    923         cltr->nprocessors += 1;
    924921        push_front(cltr->procs, *proc);
    925922        unlock    (cltr->proc_list_lock);
     
    929926        lock  (cltr->proc_list_lock __cfaabi_dbg_ctx2);
    930927        remove(cltr->procs, *proc );
    931         cltr->nprocessors -= 1;
    932928        unlock(cltr->proc_list_lock);
    933929}
  • libcfa/src/concurrency/kernel.hfa

    rf2f22e3 r8d61d620  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun 22 11:39:17 2019
    13 // Update Count     : 16
     12// Last Modified On : Tue Apr 10 14:46:49 2018
     13// Update Count     : 10
    1414//
    1515
     
    9191        this.lock = NULL;
    9292}
    93 static inline void ^?{}(FinishAction &) {}
     93static inline void ^?{}(FinishAction & this) {}
    9494
    9595// Processor
     
    176176        __dllist_t(struct processor) procs;
    177177        __dllist_t(struct processor) idles;
    178         unsigned int nprocessors;
    179 
    180         // List of threads
     178
     179        // List of processors
    181180        __spinlock_t thread_list_lock;
    182181        __dllist_t(struct thread_desc) threads;
    183         unsigned int nthreads;
    184182
    185183        // Link lists fields
     
    202200}
    203201
    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 
    207202// Local Variables: //
    208203// mode: c //
  • libcfa/src/concurrency/thread.hfa

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

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

    rf2f22e3 r8d61d620  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // boundedBufferTHREAD.c --
     7// boundedBufferEXT.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 11:50:12 2019
    13 // Update Count     : 24
     12// Last Modified On : Fri Jun 21 08:15:58 2019
     13// Update Count     : 23
    1414//
    1515
  • tools/stat.py

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