Changes in / [e02e13f:bb7422a]
- Location:
- doc/theses/mike_brooks_MMath/benchmarks/list
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/benchmarks/list/Makefile
re02e13f rbb7422a 12 12 UXX = ~/u++/u++-7.0.0/bin/u++ 13 13 14 MODE=performance 15 EXTRA_COMP_FLAGS= 16 RUN_NUM_REPS=3 14 MODE = performance 17 15 RUNARGS= 18 16 … … 103 101 perfexp--% driver--%.o : COMPILER=NO-COMPILER-FOR-$(FX_COARSE) 104 102 105 # Without this %.d rule, ordinary make runs have noise about the recipe for driver--%.o being ill-formed when called on a *.d.106 # https://stackoverflow.com/questions/3714041/why-does-this-makefile-execute-a-target-on-make-clean107 # Whatever you -include gets called as a target first.108 # One such example is driver--upp-upp--stack-insfirst-allhead.d109 # Without this %.d rule, `make make driver--upp-upp--stack-insfirst-allhead.d` leads to the rule for driver--%.o firing.110 # Though my dumb human eyes don't see the pattern as matching.111 %.d:112 @touch $@113 114 103 perfexp--% : driver--%.o observation.o 115 $(COMPILER) $ (EXTRA_COMP_FLAGS) $^ -o $@104 $(COMPILER) $^ -o $@ 116 105 117 106 driver--%.o : driver.c 118 $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 119 120 sayhi: 121 echo $(PERFPROGS) 107 $(COMPILER) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 122 108 123 109 110 111 112 RUN_NUM_REPS=3 124 113 RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)}) # 1 2 3 125 114 RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv) # run1.1csv run2.1cav run3.1csv … … 157 146 .PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o 158 147 148 159 149 -include *.d -
doc/theses/mike_brooks_MMath/benchmarks/list/_classic.c
re02e13f rbb7422a 171 171 #endif 172 172 173 volatile unsigned int t = 0; 174 volatile unsigned int i_official = 0; 175 176 #define Repeat( op ) for ( unsigned int i = 0; (i_official = i, i < NoOfNodes); i += 1 ) { op; } 173 174 #define Repeat( op ) for ( volatile unsigned int i = 0; i < NoOfNodes; i += 1 ) { op; } 177 175 178 176 int main() { … … 194 192 TAILQ_INIT(&lst); 195 193 start = clock(); 196 for ( t = 0; t < Times; t += 1 ) {194 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 197 195 Repeat( TAILQ_INSERT_TAIL( &lst, &s[i], x ) ); 198 196 Repeat( TAILQ_REMOVE( &lst, TAILQ_FIRST( &lst ), x ) ); … … 206 204 std::list<S *> lst; 207 205 start = clock(); 208 for ( t = 0; t < Times; t += 1 ) {206 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 209 207 Repeat( lst.push_back( &s[i] ) ); 210 208 Repeat( lst.pop_front() ); … … 218 216 uSequence<S> lst; 219 217 start = clock(); 220 for ( t = 0; t < Times; t += 1 ) {218 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 221 219 Repeat( lst.addTail( &s[i] ) ); 222 220 Repeat( lst.dropHead() ); … … 230 228 dlist(S) lst; 231 229 start = clock(); 232 for ( t = 0; t < Times; t += 1 ) {230 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 233 231 Repeat( insert_last( lst, s[i] ) ); 234 232 Repeat( remove( lst`first ) ); … … 242 240 Sequence(S) lst; 243 241 start = clock(); 244 for ( t = 0; t < Times; t += 1 ) {242 for ( volatile unsigned int t = 0; t < Times; t += 1 ) { 245 243 Repeat( addHead( lst, s[i] ) ); 246 244 Repeat( dropTail( lst ) ); -
doc/theses/mike_brooks_MMath/benchmarks/list/driver.c
re02e13f rbb7422a 17 17 18 18 #if defined(NDEBUG) || (defined(__cforall) && !defined(__CFA_DEBUG__)) 19 enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheck DoneFreq = 1000, DefaultExperimentDurOpCount = -1 };19 enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 1000, DefaultExperimentDurOpCount = -1 }; 20 20 #define TRACE(tp) 21 21 #else 22 enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheck DoneFreq = 2, DefaultExperimentDurOpCount = 20 };22 enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckClockFreq = 2, DefaultExperimentDurOpCount = 20 }; 23 23 static const char * tp_filter 24 24 // = ""; … … 72 72 ) 73 73 74 unsigned int uDefaultPreemption() {75 return 0;76 }77 78 74 int main(int argc, const char *argv[]) { 79 75 80 76 81 const char * usage_args = "[ExperimentDurSec [Check DoneFreq [NumNodes [ExperimentDurOpCount]]]]";77 const char * usage_args = "[ExperimentDurSec [CheckClockFreq [NumNodes [ExperimentDurOpCount]]]]"; 82 78 const int static_arg_posns = 4; 83 79 84 80 unsigned int ExperimentDurSec = DefaultExperimentDurSec; 85 unsigned int Check DoneFreq = DefaultCheckDoneFreq;81 unsigned int CheckClockFreq = DefaultCheckClockFreq; 86 82 unsigned int NumNodes = DefaultNumNodes; 87 83 size_t ExperimentDurOpCount = DefaultExperimentDurOpCount; 88 84 89 switch (( (argc - 1) < static_arg_posns) ? (argc - 1): static_arg_posns) {90 case 4: ExperimentDurOpCount = atol(argv[4]);91 case 3: NumNodes = atoi(argv[3]);92 case 2: CheckDoneFreq = atoi(argv[2]);93 case 1: ExperimentDurSec = atoi(argv[1]);85 switch ((argc < static_arg_posns) ? argc : static_arg_posns) { 86 case 5: ExperimentDurOpCount = atoi(argv[4]); 87 case 4: NumNodes = atoi(argv[3]); 88 case 3: CheckClockFreq = atoi(argv[2]); 89 case 2: ExperimentDurSec = atoi(argv[1]); 94 90 } 95 91 96 if (ExperimentDurSec == 0 || Check DoneFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {92 if (ExperimentDurSec == 0 || CheckClockFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) { 97 93 printf("usage: %s %s\n", argv[0], usage_args); 98 94 return -1; 99 95 } 100 101 #ifdef DISABLE_CLOCK_RECHECK102 if (ExperimentDurSec != -1) {103 printf("Error: experiment compiled as fixed-work only. ExperimentDurSec (currently %d) must be set to -1.\nUsage: %s %s\n", ExperimentDurSec, argv[0], usage_args);104 return -1;105 }106 #endif107 96 108 97 ui = (B_UserItem*) malloc( NumNodes * sizeof(B_UserItem) ); … … 141 130 142 131 while (elapsed_sec <= (double) ExperimentDurSec && bobs_ops_completed < ExperimentDurOpCount) { 143 for ( int t = 0; t < Check DoneFreq; t += 1 ) {132 for ( int t = 0; t < CheckClockFreq; t += 1 ) { 144 133 TRACE('a') 145 134 listedItems[0] = … … 177 166 TRACE('g') 178 167 } 179 #ifndef DISABLE_CLOCK_RECHECK180 clock_t end = clock();181 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC);182 #endif183 }184 #ifdef DISABLE_CLOCK_RECHECK185 {186 168 clock_t end = clock(); 187 169 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC); 188 170 } 189 #endif190 171 191 172 double mean_op_dur_ns = elapsed_sec / ((double)bobs_ops_completed) * 1000 * 1000 * 1000;
Note: See TracChangeset
for help on using the changeset viewer.