Changes in / [bb7422a:e02e13f]
- Location:
- doc/theses/mike_brooks_MMath/benchmarks/list
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/benchmarks/list/Makefile
rbb7422a re02e13f 12 12 UXX = ~/u++/u++-7.0.0/bin/u++ 13 13 14 MODE = performance 14 MODE=performance 15 EXTRA_COMP_FLAGS= 16 RUN_NUM_REPS=3 15 17 RUNARGS= 16 18 … … 101 103 perfexp--% driver--%.o : COMPILER=NO-COMPILER-FOR-$(FX_COARSE) 102 104 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-clean 107 # Whatever you -include gets called as a target first. 108 # One such example is driver--upp-upp--stack-insfirst-allhead.d 109 # 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 103 114 perfexp--% : driver--%.o observation.o 104 $(COMPILER) $ ^ -o $@115 $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@ 105 116 106 117 driver--%.o : driver.c 107 $(COMPILER) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 118 $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 119 120 sayhi: 121 echo $(PERFPROGS) 108 122 109 123 110 111 112 RUN_NUM_REPS=3113 124 RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)}) # 1 2 3 114 125 RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv) # run1.1csv run2.1cav run3.1csv … … 146 157 .PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o 147 158 148 149 159 -include *.d -
doc/theses/mike_brooks_MMath/benchmarks/list/_classic.c
rbb7422a re02e13f 171 171 #endif 172 172 173 174 #define Repeat( op ) for ( volatile unsigned int i = 0; i < NoOfNodes; i += 1 ) { op; } 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; } 175 177 176 178 int main() { … … 192 194 TAILQ_INIT(&lst); 193 195 start = clock(); 194 for ( volatile unsigned intt = 0; t < Times; t += 1 ) {196 for ( t = 0; t < Times; t += 1 ) { 195 197 Repeat( TAILQ_INSERT_TAIL( &lst, &s[i], x ) ); 196 198 Repeat( TAILQ_REMOVE( &lst, TAILQ_FIRST( &lst ), x ) ); … … 204 206 std::list<S *> lst; 205 207 start = clock(); 206 for ( volatile unsigned intt = 0; t < Times; t += 1 ) {208 for ( t = 0; t < Times; t += 1 ) { 207 209 Repeat( lst.push_back( &s[i] ) ); 208 210 Repeat( lst.pop_front() ); … … 216 218 uSequence<S> lst; 217 219 start = clock(); 218 for ( volatile unsigned intt = 0; t < Times; t += 1 ) {220 for ( t = 0; t < Times; t += 1 ) { 219 221 Repeat( lst.addTail( &s[i] ) ); 220 222 Repeat( lst.dropHead() ); … … 228 230 dlist(S) lst; 229 231 start = clock(); 230 for ( volatile unsigned intt = 0; t < Times; t += 1 ) {232 for ( t = 0; t < Times; t += 1 ) { 231 233 Repeat( insert_last( lst, s[i] ) ); 232 234 Repeat( remove( lst`first ) ); … … 240 242 Sequence(S) lst; 241 243 start = clock(); 242 for ( volatile unsigned intt = 0; t < Times; t += 1 ) {244 for ( t = 0; t < Times; t += 1 ) { 243 245 Repeat( addHead( lst, s[i] ) ); 244 246 Repeat( dropTail( lst ) ); -
doc/theses/mike_brooks_MMath/benchmarks/list/driver.c
rbb7422a re02e13f 17 17 18 18 #if defined(NDEBUG) || (defined(__cforall) && !defined(__CFA_DEBUG__)) 19 enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheck ClockFreq = 1000, DefaultExperimentDurOpCount = -1 };19 enum { DefaultNumNodes = 1000, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 1000, DefaultExperimentDurOpCount = -1 }; 20 20 #define TRACE(tp) 21 21 #else 22 enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheck ClockFreq = 2, DefaultExperimentDurOpCount = 20 };22 enum { DefaultNumNodes = 10, DefaultExperimentDurSec = 1, DefaultCheckDoneFreq = 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 74 78 int main(int argc, const char *argv[]) { 75 79 76 80 77 const char * usage_args = "[ExperimentDurSec [Check ClockFreq [NumNodes [ExperimentDurOpCount]]]]";81 const char * usage_args = "[ExperimentDurSec [CheckDoneFreq [NumNodes [ExperimentDurOpCount]]]]"; 78 82 const int static_arg_posns = 4; 79 83 80 84 unsigned int ExperimentDurSec = DefaultExperimentDurSec; 81 unsigned int Check ClockFreq = DefaultCheckClockFreq;85 unsigned int CheckDoneFreq = DefaultCheckDoneFreq; 82 86 unsigned int NumNodes = DefaultNumNodes; 83 87 size_t ExperimentDurOpCount = DefaultExperimentDurOpCount; 84 88 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]);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]); 90 94 } 91 95 92 if (ExperimentDurSec == 0 || Check ClockFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) {96 if (ExperimentDurSec == 0 || CheckDoneFreq == 0 || NumNodes == 0 || ExperimentDurOpCount == 0 ) { 93 97 printf("usage: %s %s\n", argv[0], usage_args); 94 98 return -1; 95 99 } 100 101 #ifdef DISABLE_CLOCK_RECHECK 102 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 #endif 96 107 97 108 ui = (B_UserItem*) malloc( NumNodes * sizeof(B_UserItem) ); … … 130 141 131 142 while (elapsed_sec <= (double) ExperimentDurSec && bobs_ops_completed < ExperimentDurOpCount) { 132 for ( int t = 0; t < Check ClockFreq; t += 1 ) {143 for ( int t = 0; t < CheckDoneFreq; t += 1 ) { 133 144 TRACE('a') 134 145 listedItems[0] = … … 166 177 TRACE('g') 167 178 } 179 #ifndef DISABLE_CLOCK_RECHECK 180 clock_t end = clock(); 181 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC); 182 #endif 183 } 184 #ifdef DISABLE_CLOCK_RECHECK 185 { 168 186 clock_t end = clock(); 169 187 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC); 170 188 } 189 #endif 171 190 172 191 double mean_op_dur_ns = elapsed_sec / ((double)bobs_ops_completed) * 1000 * 1000 * 1000;
Note: See TracChangeset
for help on using the changeset viewer.