Changeset 3f7e12cb for src/benchmark


Ignore:
Timestamp:
Nov 8, 2017, 5:43:33 PM (8 years ago)
Author:
Aaron Moss <a3moss@…>
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, stuck-waitfor-destruct, with_gc
Children:
954908d
Parents:
78315272 (diff), e35f30a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src/benchmark
Files:
24 added
8 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/benchmark/Makefile.am

    r78315272 r3f7e12cb  
    1919AM_CFLAGS = -g -Wall -Wno-unused-function -O2
    2020CC = @CFA_BINDIR@/@CFA_NAME@
     21TOOLSDIR = ${abs_top_srcdir}/tools/
     22REPEAT   = ${TOOLSDIR}repeat
     23STATS    = ${TOOLSDIR}stat.py
     24repeats  = 30
    2125
    22 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
     26.NOTPARALLEL:
     27
     28noinst_PROGRAMS =
     29
     30all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
    2331
    2432bench$(EXEEXT) :
     
    3038        rm -f ./a.out ;
    3139
    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 sched-int$(EXEEXT):
    51         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.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 monitor$(EXEEXT):
    60         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.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 
    6840csv-data$(EXEEXT):
    6941        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
    7042        @./a.out
    7143        @rm -f ./a.out
     44
     45## =========================================================================================================
     46ctxswitch$(EXEEXT): \
     47        ctxswitch-pthread.run           \
     48        ctxswitch-cfa_coroutine.run     \
     49        ctxswitch-cfa_thread.run        \
     50        ctxswitch-upp_coroutine.run     \
     51        ctxswitch-upp_thread.run
     52
     53ctxswitch-cfa_coroutine$(EXEEXT):
     54        ${CC}        ctxswitch/cfa_cor.c   -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     55
     56ctxswitch-cfa_thread$(EXEEXT):
     57        ${CC}        ctxswitch/cfa_thrd.c  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     58
     59ctxswitch-upp_coroutine$(EXEEXT):
     60        u++          ctxswitch/upp_cor.cc  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     61
     62ctxswitch-upp_thread$(EXEEXT):
     63        u++          ctxswitch/upp_thrd.cc -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     64
     65ctxswitch-pthread$(EXEEXT):
     66        @BACKEND_CC@ ctxswitch/pthreads.c  -DBENCH_N=50000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     67
     68## =========================================================================================================
     69mutex$(EXEEXT) :\
     70        mutex-function.run      \
     71        mutex-pthread_lock.run  \
     72        mutex-upp.run           \
     73        mutex-cfa1.run          \
     74        mutex-cfa2.run          \
     75        mutex-cfa4.run
     76
     77mutex-function$(EXEEXT):
     78        @BACKEND_CC@ mutex/function.c    -DBENCH_N=500000000   -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     79
     80mutex-pthread_lock$(EXEEXT):
     81        @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     82
     83mutex-upp$(EXEEXT):
     84        u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     85
     86mutex-cfa1$(EXEEXT):
     87        ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     88
     89mutex-cfa2$(EXEEXT):
     90        ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     91
     92mutex-cfa4$(EXEEXT):
     93        ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     94
     95## =========================================================================================================
     96signal$(EXEEXT) :\
     97        signal-upp.run          \
     98        signal-cfa1.run         \
     99        signal-cfa2.run         \
     100        signal-cfa4.run
     101
     102signal-upp$(EXEEXT):
     103        u++          schedint/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     104
     105signal-cfa1$(EXEEXT):
     106        ${CC}        schedint/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     107
     108signal-cfa2$(EXEEXT):
     109        ${CC}        schedint/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     110
     111signal-cfa4$(EXEEXT):
     112        ${CC}        schedint/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     113
     114## =========================================================================================================
     115waitfor$(EXEEXT) :\
     116        waitfor-upp.run         \
     117        waitfor-cfa1.run                \
     118        waitfor-cfa2.run                \
     119        waitfor-cfa4.run
     120
     121waitfor-upp$(EXEEXT):
     122        u++          schedext/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     123
     124waitfor-cfa1$(EXEEXT):
     125        ${CC}        schedext/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     126
     127waitfor-cfa2$(EXEEXT):
     128        ${CC}        schedext/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     129
     130waitfor-cfa4$(EXEEXT):
     131        ${CC}        schedext/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     132
     133## =========================================================================================================
     134creation$(EXEEXT) :\
     135        creation-pthread.run            \
     136        creation-cfa_coroutine.run      \
     137        creation-cfa_thread.run         \
     138        creation-upp_coroutine.run      \
     139        creation-upp_thread.run
     140
     141creation-cfa_coroutine$(EXEEXT):
     142        ${CC}        creation/cfa_cor.c   -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     143
     144creation-cfa_thread$(EXEEXT):
     145        ${CC}        creation/cfa_thrd.c  -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     146
     147creation-upp_coroutine$(EXEEXT):
     148        u++          creation/upp_cor.cc  -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     149
     150creation-upp_thread$(EXEEXT):
     151        u++          creation/upp_thrd.cc -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     152
     153creation-pthread$(EXEEXT):
     154        @BACKEND_CC@ creation/pthreads.c  -DBENCH_N=250000     -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     155
     156## =========================================================================================================
     157
     158%.run : %$(EXEEXT) ${REPEAT}
     159        @rm -f .result.log
     160        @echo "------------------------------------------------------"
     161        @echo $<
     162        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
     163        @${STATS} .result.log
     164        @echo "------------------------------------------------------"
     165        @rm -f a.out .result.log
     166
     167${REPEAT} :
     168        @+make -C ${TOOLSDIR} repeat
  • src/benchmark/Makefile.in

    r78315272 r3f7e12cb  
    9292build_triplet = @build@
    9393host_triplet = @host@
     94noinst_PROGRAMS =
    9495subdir = src/benchmark
    9596ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    103104CONFIG_CLEAN_VPATH_FILES =
    104105PROGRAMS = $(noinst_PROGRAMS)
    105 bench_SOURCES = bench.c
    106 bench_OBJECTS = bench.$(OBJEXT)
    107 bench_LDADD = $(LDADD)
    108 csv_data_SOURCES = csv-data.c
    109 csv_data_OBJECTS = csv-data.$(OBJEXT)
    110 csv_data_LDADD = $(LDADD)
    111 ctxswitch_coroutine_SOURCES = ctxswitch-coroutine.c
    112 ctxswitch_coroutine_OBJECTS = ctxswitch-coroutine.$(OBJEXT)
    113 ctxswitch_coroutine_LDADD = $(LDADD)
    114 ctxswitch_thread_SOURCES = ctxswitch-thread.c
    115 ctxswitch_thread_OBJECTS = ctxswitch-thread.$(OBJEXT)
    116 ctxswitch_thread_LDADD = $(LDADD)
    117 monitor_SOURCES = monitor.c
    118 monitor_OBJECTS = monitor.$(OBJEXT)
    119 monitor_LDADD = $(LDADD)
    120 sched_int_SOURCES = sched-int.c
    121 sched_int_OBJECTS = sched-int.$(OBJEXT)
    122 sched_int_LDADD = $(LDADD)
    123106AM_V_P = $(am__v_P_@AM_V@)
    124107am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
     
    133116am__v_at_0 = @
    134117am__v_at_1 =
    135 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
    136 depcomp = $(SHELL) $(top_srcdir)/automake/depcomp
    137 am__depfiles_maybe = depfiles
    138 am__mv = mv -f
    139 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
    140         $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
    141 AM_V_CC = $(am__v_CC_@AM_V@)
    142 am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
    143 am__v_CC_0 = @echo "  CC      " $@;
    144 am__v_CC_1 =
    145 CCLD = $(CC)
    146 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
    147 AM_V_CCLD = $(am__v_CCLD_@AM_V@)
    148 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
    149 am__v_CCLD_0 = @echo "  CCLD    " $@;
    150 am__v_CCLD_1 =
    151 SOURCES = bench.c csv-data.c ctxswitch-coroutine.c ctxswitch-thread.c \
    152         monitor.c sched-int.c
    153 DIST_SOURCES = bench.c csv-data.c ctxswitch-coroutine.c \
    154         ctxswitch-thread.c monitor.c sched-int.c
     118SOURCES =
     119DIST_SOURCES =
    155120am__can_run_installinfo = \
    156121  case $$AM_UPDATE_INFO_DIR in \
     
    159124  esac
    160125am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
    161 # Read a list of newline-separated strings from the standard input,
    162 # and print each of them once, without duplicates.  Input order is
    163 # *not* preserved.
    164 am__uniquify_input = $(AWK) '\
    165   BEGIN { nonempty = 0; } \
    166   { items[$$0] = 1; nonempty = 1; } \
    167   END { if (nonempty) { for (i in items) print i; }; } \
    168 '
    169 # Make sure the list of sources is unique.  This is necessary because,
    170 # e.g., the same source file might be shared among _SOURCES variables
    171 # for different programs/libraries.
    172 am__define_uniq_tagged_files = \
    173   list='$(am__tagged_files)'; \
    174   unique=`for i in $$list; do \
    175     if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
    176   done | $(am__uniquify_input)`
    177 ETAGS = etags
    178 CTAGS = ctags
    179 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/automake/depcomp
     126am__DIST_COMMON = $(srcdir)/Makefile.in
    180127DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    181128ACLOCAL = @ACLOCAL@
     
    302249top_srcdir = @top_srcdir@
    303250AM_CFLAGS = -g -Wall -Wno-unused-function -O2
    304 noinst_PROGRAMS = bench$(EXEEXT) ctxswitch-coroutine$(EXEEXT) ctxswitch-thread$(EXEEXT) sched-int$(EXEEXT) monitor$(EXEEXT) csv-data$(EXEEXT)
     251TOOLSDIR = ${abs_top_srcdir}/tools/
     252REPEAT = ${TOOLSDIR}repeat
     253STATS = ${TOOLSDIR}stat.py
     254repeats = 30
    305255all: all-am
    306256
    307257.SUFFIXES:
    308 .SUFFIXES: .c .o .obj
    309258$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
    310259        @for dep in $?; do \
     
    339288clean-noinstPROGRAMS:
    340289        -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
    341 
    342 mostlyclean-compile:
    343         -rm -f *.$(OBJEXT)
    344 
    345 distclean-compile:
    346         -rm -f *.tab.c
    347 
    348 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bench.Po@am__quote@
    349 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csv-data.Po@am__quote@
    350 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctxswitch-coroutine.Po@am__quote@
    351 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ctxswitch-thread.Po@am__quote@
    352 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/monitor.Po@am__quote@
    353 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched-int.Po@am__quote@
    354 
    355 .c.o:
    356 @am__fastdepCC_TRUE@    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
    357 @am__fastdepCC_TRUE@    $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
    358 @am__fastdepCC_TRUE@    $(am__mv) $$depbase.Tpo $$depbase.Po
    359 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
    360 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    361 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
    362 
    363 .c.obj:
    364 @am__fastdepCC_TRUE@    $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
    365 @am__fastdepCC_TRUE@    $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
    366 @am__fastdepCC_TRUE@    $(am__mv) $$depbase.Tpo $$depbase.Po
    367 @AMDEP_TRUE@@am__fastdepCC_FALSE@       $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
    368 @AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    369 @am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
    370 
    371 ID: $(am__tagged_files)
    372         $(am__define_uniq_tagged_files); mkid -fID $$unique
    373 tags: tags-am
    374 TAGS: tags
    375 
    376 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    377         set x; \
    378         here=`pwd`; \
    379         $(am__define_uniq_tagged_files); \
    380         shift; \
    381         if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
    382           test -n "$$unique" || unique=$$empty_fix; \
    383           if test $$# -gt 0; then \
    384             $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    385               "$$@" $$unique; \
    386           else \
    387             $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    388               $$unique; \
    389           fi; \
    390         fi
    391 ctags: ctags-am
    392 
    393 CTAGS: ctags
    394 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    395         $(am__define_uniq_tagged_files); \
    396         test -z "$(CTAGS_ARGS)$$unique" \
    397           || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
    398              $$unique
    399 
    400 GTAGS:
    401         here=`$(am__cd) $(top_builddir) && pwd` \
    402           && $(am__cd) $(top_srcdir) \
    403           && gtags -i $(GTAGS_ARGS) "$$here"
    404 cscopelist: cscopelist-am
    405 
    406 cscopelist-am: $(am__tagged_files)
    407         list='$(am__tagged_files)'; \
    408         case "$(srcdir)" in \
    409           [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
    410           *) sdir=$(subdir)/$(srcdir) ;; \
    411         esac; \
    412         for i in $$list; do \
    413           if test -f "$$i"; then \
    414             echo "$(subdir)/$$i"; \
    415           else \
    416             echo "$$sdir/$$i"; \
    417           fi; \
    418         done >> $(top_builddir)/cscope.files
    419 
    420 distclean-tags:
    421         -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
     290tags TAGS:
     291
     292ctags CTAGS:
     293
     294cscope cscopelist:
     295
    422296
    423297distdir: $(DISTFILES)
     
    490364
    491365distclean: distclean-am
    492         -rm -rf ./$(DEPDIR)
    493366        -rm -f Makefile
    494 distclean-am: clean-am distclean-compile distclean-generic \
    495         distclean-tags
     367distclean-am: clean-am distclean-generic
    496368
    497369dvi: dvi-am
     
    536408
    537409maintainer-clean: maintainer-clean-am
    538         -rm -rf ./$(DEPDIR)
    539410        -rm -f Makefile
    540411maintainer-clean-am: distclean-am maintainer-clean-generic
     
    542413mostlyclean: mostlyclean-am
    543414
    544 mostlyclean-am: mostlyclean-compile mostlyclean-generic
     415mostlyclean-am: mostlyclean-generic
    545416
    546417pdf: pdf-am
     
    556427.MAKE: install-am install-strip
    557428
    558 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
    559         clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \
    560         distclean-compile distclean-generic distclean-tags distdir dvi \
    561         dvi-am html html-am info info-am install install-am \
    562         install-data install-data-am install-dvi install-dvi-am \
    563         install-exec install-exec-am install-html install-html-am \
    564         install-info install-info-am install-man install-pdf \
    565         install-pdf-am install-ps install-ps-am install-strip \
    566         installcheck installcheck-am installdirs maintainer-clean \
    567         maintainer-clean-generic mostlyclean mostlyclean-compile \
    568         mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
     429.PHONY: all all-am check check-am clean clean-generic \
     430        clean-noinstPROGRAMS cscopelist-am ctags-am distclean \
     431        distclean-generic distdir dvi dvi-am html html-am info info-am \
     432        install install-am install-data install-data-am install-dvi \
     433        install-dvi-am install-exec install-exec-am install-html \
     434        install-html-am install-info install-info-am install-man \
     435        install-pdf install-pdf-am install-ps install-ps-am \
     436        install-strip installcheck installcheck-am installdirs \
     437        maintainer-clean maintainer-clean-generic mostlyclean \
     438        mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
    569439        uninstall-am
    570440
    571441.PRECIOUS: Makefile
    572442
     443
     444.NOTPARALLEL:
     445
     446all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT)
    573447
    574448bench$(EXEEXT) :
     
    580454        rm -f ./a.out ;
    581455
    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 sched-int$(EXEEXT):
    601         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 SchedInt.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 monitor$(EXEEXT):
    610         ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -DN=50000000 Monitor.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 
    618456csv-data$(EXEEXT):
    619457        @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c
     
    621459        @rm -f ./a.out
    622460
     461ctxswitch$(EXEEXT): \
     462        ctxswitch-pthread.run           \
     463        ctxswitch-cfa_coroutine.run     \
     464        ctxswitch-cfa_thread.run        \
     465        ctxswitch-upp_coroutine.run     \
     466        ctxswitch-upp_thread.run
     467
     468ctxswitch-cfa_coroutine$(EXEEXT):
     469        ${CC}        ctxswitch/cfa_cor.c   -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     470
     471ctxswitch-cfa_thread$(EXEEXT):
     472        ${CC}        ctxswitch/cfa_thrd.c  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     473
     474ctxswitch-upp_coroutine$(EXEEXT):
     475        u++          ctxswitch/upp_cor.cc  -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     476
     477ctxswitch-upp_thread$(EXEEXT):
     478        u++          ctxswitch/upp_thrd.cc -DBENCH_N=50000000  -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     479
     480ctxswitch-pthread$(EXEEXT):
     481        @BACKEND_CC@ ctxswitch/pthreads.c  -DBENCH_N=50000000  -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     482
     483mutex$(EXEEXT) :\
     484        mutex-function.run      \
     485        mutex-pthread_lock.run  \
     486        mutex-upp.run           \
     487        mutex-cfa1.run          \
     488        mutex-cfa2.run          \
     489        mutex-cfa4.run
     490
     491mutex-function$(EXEEXT):
     492        @BACKEND_CC@ mutex/function.c    -DBENCH_N=500000000   -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     493
     494mutex-pthread_lock$(EXEEXT):
     495        @BACKEND_CC@ mutex/pthreads.c    -DBENCH_N=50000000    -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     496
     497mutex-upp$(EXEEXT):
     498        u++          mutex/upp.cc        -DBENCH_N=50000000    -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     499
     500mutex-cfa1$(EXEEXT):
     501        ${CC}        mutex/cfa1.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     502
     503mutex-cfa2$(EXEEXT):
     504        ${CC}        mutex/cfa2.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     505
     506mutex-cfa4$(EXEEXT):
     507        ${CC}        mutex/cfa4.c        -DBENCH_N=5000000     -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     508
     509signal$(EXEEXT) :\
     510        signal-upp.run          \
     511        signal-cfa1.run         \
     512        signal-cfa2.run         \
     513        signal-cfa4.run
     514
     515signal-upp$(EXEEXT):
     516        u++          schedint/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     517
     518signal-cfa1$(EXEEXT):
     519        ${CC}        schedint/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     520
     521signal-cfa2$(EXEEXT):
     522        ${CC}        schedint/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     523
     524signal-cfa4$(EXEEXT):
     525        ${CC}        schedint/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     526
     527waitfor$(EXEEXT) :\
     528        waitfor-upp.run         \
     529        waitfor-cfa1.run                \
     530        waitfor-cfa2.run                \
     531        waitfor-cfa4.run
     532
     533waitfor-upp$(EXEEXT):
     534        u++          schedext/upp.cc     -DBENCH_N=5000000     -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     535
     536waitfor-cfa1$(EXEEXT):
     537        ${CC}        schedext/cfa1.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     538
     539waitfor-cfa2$(EXEEXT):
     540        ${CC}        schedext/cfa2.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     541
     542waitfor-cfa4$(EXEEXT):
     543        ${CC}        schedext/cfa4.c     -DBENCH_N=500000      -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     544
     545creation$(EXEEXT) :\
     546        creation-pthread.run            \
     547        creation-cfa_coroutine.run      \
     548        creation-cfa_thread.run         \
     549        creation-upp_coroutine.run      \
     550        creation-upp_thread.run
     551
     552creation-cfa_coroutine$(EXEEXT):
     553        ${CC}        creation/cfa_cor.c   -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     554
     555creation-cfa_thread$(EXEEXT):
     556        ${CC}        creation/cfa_thrd.c  -DBENCH_N=10000000   -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     557
     558creation-upp_coroutine$(EXEEXT):
     559        u++          creation/upp_cor.cc  -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     560
     561creation-upp_thread$(EXEEXT):
     562        u++          creation/upp_thrd.cc -DBENCH_N=50000000   -I. -nodebug -lrt -quiet             ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     563
     564creation-pthread$(EXEEXT):
     565        @BACKEND_CC@ creation/pthreads.c  -DBENCH_N=250000     -I. -lrt -pthread                    ${AM_CFLAGS} ${CFLAGS} ${ccflags}
     566
     567%.run : %$(EXEEXT) ${REPEAT}
     568        @rm -f .result.log
     569        @echo "------------------------------------------------------"
     570        @echo $<
     571        @${REPEAT} ${repeats} ./a.out | tee -a .result.log
     572        @${STATS} .result.log
     573        @echo "------------------------------------------------------"
     574        @rm -f a.out .result.log
     575
     576${REPEAT} :
     577        @+make -C ${TOOLSDIR} repeat
     578
    623579# Tell versions [3.59,3.63) of GNU make to not export all variables.
    624580# Otherwise a system limit (for SysV at least) may be exceeded.
  • src/benchmark/bench.h

    r78315272 r3f7e12cb  
    11#pragma once
    22
     3#if defined(__CFORALL__)
    34extern "C" {
     5#endif
     6        #include <stdlib.h>
    47        #include <unistd.h>                                     // sysconf
    58        #include <sys/times.h>                                  // times
    69        #include <time.h>
     10#if defined(__CFORALL__)
    711}
     12#endif
    813
    9 inline unsigned long long int Time() {
    10     timespec ts;
     14static inline unsigned long long int Time() {
     15    struct timespec ts;
    1116    clock_gettime(
    1217#if defined( __linux__ )
     
    2328} // Time
    2429
    25 #ifndef N
    26 #define N 10000000
     30#ifndef BENCH_N
     31#define BENCH_N 500 //10000000
    2732#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        long long int StartTime, EndTime;       \
     41        StartTime = Time();                     \
     42        statement;                                      \
     43        EndTime = Time();                               \
     44        unsigned long long int output =         \
     45        ( EndTime - StartTime ) / n;
    2846
    2947unsigned int default_preemption() {
  • src/benchmark/csv-data.c

    r78315272 r3f7e12cb  
    111111        StartTime = Time();
    112112        for( int i = 0;; i++ ) {
    113                 signal(&cond1a);
    114                 if( i > N ) break;
    115                 wait(&cond1b);
     113                signal(cond1a);
     114                if( i > N ) break;
     115                wait(cond1b);
    116116        }
    117117        EndTime = Time();
     
    122122void side1B( mon_t & mutex a ) {
    123123        for( int i = 0;; i++ ) {
    124                 signal(&cond1b);
    125                 if( i > N ) break;
    126                 wait(&cond1a);
     124                signal(cond1b);
     125                if( i > N ) break;
     126                wait(cond1a);
    127127        }
    128128}
     
    159159        StartTime = Time();
    160160        for( int i = 0;; i++ ) {
    161                 signal(&cond2a);
    162                 if( i > N ) break;
    163                 wait(&cond2b);
     161                signal(cond2a);
     162                if( i > N ) break;
     163                wait(cond2b);
    164164        }
    165165        EndTime = Time();
     
    170170void side2B( mon_t & mutex a, mon_t & mutex b ) {
    171171        for( int i = 0;; i++ ) {
    172                 signal(&cond2b);
    173                 if( i > N ) break;
    174                 wait(&cond2a);
     172                signal(cond2b);
     173                if( i > N ) break;
     174                wait(cond2a);
    175175        }
    176176}
Note: See TracChangeset for help on using the changeset viewer.