Changeset 034165a


Ignore:
Timestamp:
Oct 26, 2017, 11:17:20 AM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
4149d9d
Parents:
f1dd17a
Message:

renamed and updated benchmarks for consistency

Location:
src/benchmark
Files:
7 added
5 deleted
3 edited
3 moved

Legend:

Unmodified
Added
Removed
  • src/benchmark/Makefile.am

    rf1dd17a r034165a  
    1919AM_CFLAGS = -g -Wall -Wno-unused-function -O2
    2020CC = @CFA_BINDIR@/@CFA_NAME@
     21REPEAT = ${abs_top_srcdir}/tools/a.out
     22repeats = 30
     23
     24.NOTPARALLEL:
    2125
    2226noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
     
    3034        rm -f ./a.out ;
    3135
    32 ctxswitch-coroutine$(EXEEXT):
    33         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c
    34         @rm -f .result.log
    35         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    36                 ./a.out | tee -a .result.log ; \
    37         done
    38         @./stat.py .result.log
    39         @rm -f a.out .result.log
    40 
    41 ctxswitch-thread$(EXEEXT):
    42         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c
    43         @rm -f .result.log
    44         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    45                 ./a.out | tee -a .result.log ; \
    46         done
    47         @./stat.py .result.log
    48         @rm -f a.out .result.log
    49 
    50 ctxswitch-pthread$(EXEEXT):
    51         @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -lrt -pthread -DN=50000000 PthrdCtxSwitch.c
    52         @rm -f .result.log
    53         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    54                 ./a.out | tee -a .result.log ; \
    55         done
    56         @./stat.py .result.log
    57         @rm -f a.out .result.log
    58 
    59 sched-int$(EXEEXT):
    60         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
    61         @rm -f .result.log
    62         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    63                 ./a.out | tee -a .result.log ; \
    64         done
    65         @./stat.py .result.log
    66         @rm -f a.out .result.log
    67 
    68 monitor$(EXEEXT):
    69         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
    70         @rm -f .result.log
    71         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    72                 ./a.out | tee -a .result.log ; \
    73         done
    74         @./stat.py .result.log
    75         @rm -f a.out .result.log
    76 
    7736csv-data$(EXEEXT):
    7837        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
    7938        @./a.out
    8039        @rm -f ./a.out
     40
     41## =========================================================================================================
     42ctxswitch$(EXEEXT): \
     43        ctxswitch-cfa_coroutine.run     \
     44        ctxswitch-cfa_thread.run        \
     45        ctxswitch-upp_coroutine.run     \
     46        ctxswitch-upp_thread.run        \
     47        ctxswitch-pthread.run
     48
     49ctxswitch-cfa_coroutine$(EXEEXT):
     50        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_cor.c
     51
     52ctxswitch-cfa_thread$(EXEEXT):
     53        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_thrd.c
     54
     55ctxswitch-upp_coroutine$(EXEEXT):
     56        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc
     57
     58ctxswitch-upp_thread$(EXEEXT):
     59        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc
     60
     61ctxswitch-pthread$(EXEEXT):
     62        @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DN=50000000 ctxswitch/pthreads.c
     63
     64## =========================================================================================================
     65creation$(EXEEXT) :\
     66        creation-pthread.run            \
     67        creation-cfa_coroutine.run      \
     68        creation-cfa_thread.run         \
     69        creation-upp_coroutine.run      \
     70        creation-upp_thread.run
     71
     72creation-cfa_coroutine$(EXEEXT):
     73        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=500000000 creation/cfa_cor.c
     74
     75creation-cfa_thread$(EXEEXT):
     76        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=10000000 creation/cfa_thrd.c
     77
     78creation-upp_coroutine$(EXEEXT):
     79        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc
     80
     81creation-upp_thread$(EXEEXT):
     82        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc
     83
     84creation-pthread$(EXEEXT):
     85        @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DBENCH_N=2500000 creation/pthreads.c
     86
     87## =========================================================================================================
     88sched-int$(EXEEXT):
     89        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
     90
     91monitor$(EXEEXT):
     92        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
     93
     94%.run : %$(EXEEXT)
     95        @rm -f .result.log
     96        @./catchsig
     97        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
     98        @./stat.py .result.log
     99        @rm -f a.out .result.log
  • src/benchmark/Makefile.in

    rf1dd17a r034165a  
    302302top_srcdir = @top_srcdir@
    303303AM_CFLAGS = -g -Wall -Wno-unused-function -O2
     304REPEAT = ${abs_top_srcdir}/tools/a.out
     305repeats = 30
    304306noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
    305307all: all-am
     
    339341clean-noinstPROGRAMS:
    340342        -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
     343
     344ctxswitch-coroutine$(EXEEXT): $(ctxswitch_coroutine_OBJECTS) $(ctxswitch_coroutine_DEPENDENCIES) $(EXTRA_ctxswitch_coroutine_DEPENDENCIES)
     345        @rm -f ctxswitch-coroutine$(EXEEXT)
     346        $(AM_V_CCLD)$(LINK) $(ctxswitch_coroutine_OBJECTS) $(ctxswitch_coroutine_LDADD) $(LIBS)
     347
     348ctxswitch-thread$(EXEEXT): $(ctxswitch_thread_OBJECTS) $(ctxswitch_thread_DEPENDENCIES) $(EXTRA_ctxswitch_thread_DEPENDENCIES)
     349        @rm -f ctxswitch-thread$(EXEEXT)
     350        $(AM_V_CCLD)$(LINK) $(ctxswitch_thread_OBJECTS) $(ctxswitch_thread_LDADD) $(LIBS)
    341351
    342352mostlyclean-compile:
     
    572582
    573583
     584.NOTPARALLEL:
     585
    574586bench$(EXEEXT) :
    575587        @for ccflags in "-debug" "-nodebug"; do \
     
    580592        rm -f ./a.out ;
    581593
    582 ctxswitch-coroutine$(EXEEXT):
    583         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c
    584         @rm -f .result.log
    585         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    586                 ./a.out | tee -a .result.log ; \
    587         done
    588         @./stat.py .result.log
    589         @rm -f a.out .result.log
    590 
    591 ctxswitch-thread$(EXEEXT):
    592         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c
    593         @rm -f .result.log
    594         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    595                 ./a.out | tee -a .result.log ; \
    596         done
    597         @./stat.py .result.log
    598         @rm -f a.out .result.log
    599 
    600 ctxswitch-pthread$(EXEEXT):
    601         @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -lrt -pthread -DN=50000000 PthrdCtxSwitch.c
    602         @rm -f .result.log
    603         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    604                 ./a.out | tee -a .result.log ; \
    605         done
    606         @./stat.py .result.log
    607         @rm -f a.out .result.log
    608 
    609 sched-int$(EXEEXT):
    610         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
    611         @rm -f .result.log
    612         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    613                 ./a.out | tee -a .result.log ; \
    614         done
    615         @./stat.py .result.log
    616         @rm -f a.out .result.log
    617 
    618 monitor$(EXEEXT):
    619         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
    620         @rm -f .result.log
    621         @for number in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do \
    622                 ./a.out | tee -a .result.log ; \
    623         done
    624         @./stat.py .result.log
    625         @rm -f a.out .result.log
    626 
    627594csv-data$(EXEEXT):
    628595        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
     
    630597        @rm -f ./a.out
    631598
     599ctxswitch$(EXEEXT): \
     600        ctxswitch-cfa_coroutine.run     \
     601        ctxswitch-cfa_thread.run        \
     602        ctxswitch-upp_coroutine.run     \
     603        ctxswitch-upp_thread.run        \
     604        ctxswitch-pthread.run
     605
     606ctxswitch-cfa_coroutine$(EXEEXT):
     607        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_cor.c
     608
     609ctxswitch-cfa_thread$(EXEEXT):
     610        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_thrd.c
     611
     612ctxswitch-upp_coroutine$(EXEEXT):
     613        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc
     614
     615ctxswitch-upp_thread$(EXEEXT):
     616        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc
     617
     618ctxswitch-pthread$(EXEEXT):
     619        @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DN=50000000 ctxswitch/pthreads.c
     620
     621creation$(EXEEXT) :\
     622        creation-pthread.run            \
     623        creation-cfa_coroutine.run      \
     624        creation-cfa_thread.run         \
     625        creation-upp_coroutine.run      \
     626        creation-upp_thread.run
     627
     628creation-cfa_coroutine$(EXEEXT):
     629        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=500000000 creation/cfa_cor.c
     630
     631creation-cfa_thread$(EXEEXT):
     632        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=10000000 creation/cfa_thrd.c
     633
     634creation-upp_coroutine$(EXEEXT):
     635        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc
     636
     637creation-upp_thread$(EXEEXT):
     638        u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc
     639
     640creation-pthread$(EXEEXT):
     641        @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DBENCH_N=2500000 creation/pthreads.c
     642
     643sched-int$(EXEEXT):
     644        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c
     645
     646monitor$(EXEEXT):
     647        ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c
     648
     649%.run : %$(EXEEXT)
     650        @rm -f .result.log
     651        @./catchsig
     652        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
     653        @./stat.py .result.log
     654        @rm -f a.out .result.log
     655
    632656# Tell versions [3.59,3.63) of GNU make to not export all variables.
    633657# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/benchmark/bench.h

    rf1dd17a r034165a  
    11#pragma once
    22
    3 #ifdef __CFORALL__
     3#if defined(__CFORALL__)
    44extern "C" {
    55#endif
     6        #include <stdlib.h>
    67        #include <unistd.h>                                     // sysconf
    78        #include <sys/times.h>                                  // times
    89        #include <time.h>
    9 #ifdef __CFORALL__
     10#if defined(__CFORALL__)
    1011}
    1112#endif
     
    2728} // Time
    2829
    29 #ifndef N
    30 #define N 10000000
     30#ifndef BENCH_N
     31#define BENCH_N 500 //10000000
    3132#endif
     33
     34#define BENCH(statement, output)                \
     35        size_t n = BENCH_N;                                     \
     36        if( argc > 2 ) return 1;                        \
     37        if( argc == 2 ) {                                       \
     38                n = atoi(argv[1]);                              \
     39        }                                                                       \
     40        const unsigned int NoOfTimes = n;       \
     41        long long int StartTime, EndTime;       \
     42        StartTime = Time();                                     \
     43        statement;                                                      \
     44        EndTime = Time();                                       \
     45        unsigned long long int output =         \
     46        ( EndTime - StartTime ) / NoOfTimes;
    3247
    3348unsigned int default_preemption() {
  • src/benchmark/ctxswitch/cfa_cor.c

    rf1dd17a r034165a  
    2424}
    2525
    26 int main() {
    27         const unsigned int NoOfTimes = N;
    28         long long int StartTime, EndTime;
    29 
     26int main(int argc, char* argv[]) {
    3027        GreatSuspender s;
    3128
    32         StartTime = Time();
    33         resumer( s, NoOfTimes );
    34         EndTime = Time();
     29        BENCH(
     30                resumer( s, NoOfTimes );,
     31                result
     32        )
    3533
    36         sout | ( EndTime - StartTime ) / NoOfTimes | endl;
     34        sout | result | endl;
    3735}
Note: See TracChangeset for help on using the changeset viewer.