Changeset 034165a for src/benchmark
- Timestamp:
- Oct 26, 2017, 11:17:20 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 4149d9d
- Parents:
- f1dd17a
- Location:
- src/benchmark
- Files:
-
- 7 added
- 5 deleted
- 3 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
src/benchmark/Makefile.am
rf1dd17a r034165a 19 19 AM_CFLAGS = -g -Wall -Wno-unused-function -O2 20 20 CC = @CFA_BINDIR@/@CFA_NAME@ 21 REPEAT = ${abs_top_srcdir}/tools/a.out 22 repeats = 30 23 24 .NOTPARALLEL: 21 25 22 26 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) … … 30 34 rm -f ./a.out ; 31 35 32 ctxswitch-coroutine$(EXEEXT):33 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c34 @rm -f .result.log35 @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 done38 @./stat.py .result.log39 @rm -f a.out .result.log40 41 ctxswitch-thread$(EXEEXT):42 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c43 @rm -f .result.log44 @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 done47 @./stat.py .result.log48 @rm -f a.out .result.log49 50 ctxswitch-pthread$(EXEEXT):51 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -lrt -pthread -DN=50000000 PthrdCtxSwitch.c52 @rm -f .result.log53 @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 done56 @./stat.py .result.log57 @rm -f a.out .result.log58 59 sched-int$(EXEEXT):60 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c61 @rm -f .result.log62 @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 done65 @./stat.py .result.log66 @rm -f a.out .result.log67 68 monitor$(EXEEXT):69 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c70 @rm -f .result.log71 @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 done74 @./stat.py .result.log75 @rm -f a.out .result.log76 77 36 csv-data$(EXEEXT): 78 37 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c 79 38 @./a.out 80 39 @rm -f ./a.out 40 41 ## ========================================================================================================= 42 ctxswitch$(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 49 ctxswitch-cfa_coroutine$(EXEEXT): 50 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_cor.c 51 52 ctxswitch-cfa_thread$(EXEEXT): 53 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_thrd.c 54 55 ctxswitch-upp_coroutine$(EXEEXT): 56 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc 57 58 ctxswitch-upp_thread$(EXEEXT): 59 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc 60 61 ctxswitch-pthread$(EXEEXT): 62 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DN=50000000 ctxswitch/pthreads.c 63 64 ## ========================================================================================================= 65 creation$(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 72 creation-cfa_coroutine$(EXEEXT): 73 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=500000000 creation/cfa_cor.c 74 75 creation-cfa_thread$(EXEEXT): 76 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=10000000 creation/cfa_thrd.c 77 78 creation-upp_coroutine$(EXEEXT): 79 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc 80 81 creation-upp_thread$(EXEEXT): 82 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc 83 84 creation-pthread$(EXEEXT): 85 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DBENCH_N=2500000 creation/pthreads.c 86 87 ## ========================================================================================================= 88 sched-int$(EXEEXT): 89 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c 90 91 monitor$(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 302 302 top_srcdir = @top_srcdir@ 303 303 AM_CFLAGS = -g -Wall -Wno-unused-function -O2 304 REPEAT = ${abs_top_srcdir}/tools/a.out 305 repeats = 30 304 306 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT) 305 307 all: all-am … … 339 341 clean-noinstPROGRAMS: 340 342 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) 343 344 ctxswitch-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 348 ctxswitch-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) 341 351 342 352 mostlyclean-compile: … … 572 582 573 583 584 .NOTPARALLEL: 585 574 586 bench$(EXEEXT) : 575 587 @for ccflags in "-debug" "-nodebug"; do \ … … 580 592 rm -f ./a.out ; 581 593 582 ctxswitch-coroutine$(EXEEXT):583 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 CorCtxSwitch.c584 @rm -f .result.log585 @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 done588 @./stat.py .result.log589 @rm -f a.out .result.log590 591 ctxswitch-thread$(EXEEXT):592 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 ThrdCtxSwitch.c593 @rm -f .result.log594 @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 done597 @./stat.py .result.log598 @rm -f a.out .result.log599 600 ctxswitch-pthread$(EXEEXT):601 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -lrt -pthread -DN=50000000 PthrdCtxSwitch.c602 @rm -f .result.log603 @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 done606 @./stat.py .result.log607 @rm -f a.out .result.log608 609 sched-int$(EXEEXT):610 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c611 @rm -f .result.log612 @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 done615 @./stat.py .result.log616 @rm -f a.out .result.log617 618 monitor$(EXEEXT):619 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.c620 @rm -f .result.log621 @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 done624 @./stat.py .result.log625 @rm -f a.out .result.log626 627 594 csv-data$(EXEEXT): 628 595 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c … … 630 597 @rm -f ./a.out 631 598 599 ctxswitch$(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 606 ctxswitch-cfa_coroutine$(EXEEXT): 607 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_cor.c 608 609 ctxswitch-cfa_thread$(EXEEXT): 610 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DN=50000000 ctxswitch/cfa_thrd.c 611 612 ctxswitch-upp_coroutine$(EXEEXT): 613 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc 614 615 ctxswitch-upp_thread$(EXEEXT): 616 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DN=50000000 ctxswitch/upp_cor.cc 617 618 ctxswitch-pthread$(EXEEXT): 619 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DN=50000000 ctxswitch/pthreads.c 620 621 creation$(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 628 creation-cfa_coroutine$(EXEEXT): 629 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=500000000 creation/cfa_cor.c 630 631 creation-cfa_thread$(EXEEXT): 632 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -I. -nodebug -lrt -DBENCH_N=10000000 creation/cfa_thrd.c 633 634 creation-upp_coroutine$(EXEEXT): 635 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc 636 637 creation-upp_thread$(EXEEXT): 638 u++ ${AM_CFLAGS} ${CFLAGS} ${ccflags} ${ccflags} -I. -nodebug -lrt -DBENCH_N=50000000 creation/upp_cor.cc 639 640 creation-pthread$(EXEEXT): 641 @BACKEND_CC@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -I. -lrt -pthread -DBENCH_N=2500000 creation/pthreads.c 642 643 sched-int$(EXEEXT): 644 ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.c 645 646 monitor$(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 632 656 # Tell versions [3.59,3.63) of GNU make to not export all variables. 633 657 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/benchmark/bench.h
rf1dd17a r034165a 1 1 #pragma once 2 2 3 #if def __CFORALL__3 #if defined(__CFORALL__) 4 4 extern "C" { 5 5 #endif 6 #include <stdlib.h> 6 7 #include <unistd.h> // sysconf 7 8 #include <sys/times.h> // times 8 9 #include <time.h> 9 #if def __CFORALL__10 #if defined(__CFORALL__) 10 11 } 11 12 #endif … … 27 28 } // Time 28 29 29 #ifndef N30 #define N1000000030 #ifndef BENCH_N 31 #define BENCH_N 500 //10000000 31 32 #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; 32 47 33 48 unsigned int default_preemption() { -
src/benchmark/ctxswitch/cfa_cor.c
rf1dd17a r034165a 24 24 } 25 25 26 int main() { 27 const unsigned int NoOfTimes = N; 28 long long int StartTime, EndTime; 29 26 int main(int argc, char* argv[]) { 30 27 GreatSuspender s; 31 28 32 StartTime = Time(); 33 resumer( s, NoOfTimes ); 34 EndTime = Time(); 29 BENCH( 30 resumer( s, NoOfTimes );, 31 result 32 ) 35 33 36 sout | ( EndTime - StartTime ) / NoOfTimes| endl;34 sout | result | endl; 37 35 }
Note: See TracChangeset
for help on using the changeset viewer.