Changeset 1dfc3d0 for doc/theses
- Timestamp:
- Apr 4, 2023, 1:17:44 PM (21 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- b0be909f
- Parents:
- 34b6a7b6
- Location:
- doc/theses/mike_brooks_MMath/benchmarks/list
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/benchmarks/list/Makefile
r34b6a7b6 r1dfc3d0 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 … … 102 104 103 105 perfexp--% : driver--%.o observation.o 104 $(COMPILER) $ ^ -o $@106 $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@ 105 107 106 108 driver--%.o : driver.c 107 $(COMPILER) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 109 $(COMPILER) $(EXTRA_COMP_FLAGS) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD 110 111 sayhi: 112 echo $(PERFPROGS) 108 113 109 114 110 111 112 RUN_NUM_REPS=3113 115 RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)}) # 1 2 3 114 116 RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv) # run1.1csv run2.1cav run3.1csv … … 146 148 .PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o 147 149 148 149 150 -include *.d -
doc/theses/mike_brooks_MMath/benchmarks/list/driver.c
r34b6a7b6 r1dfc3d0 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) ); … … 100 111 listedItems = (BFX_LISTED_ELEM_T(B_UserItem)*)malloc( NumNodes * sizeof(BFX_LISTED_ELEM_T(B_UserItem)) ); 101 112 memset(listedItems, 0, NumNodes * sizeof(BFX_LISTED_ELEM_T(B_UserItem))); 113 114 printf("ui @ %p\nlistedItems @ %p\n\n", ui, listedItems); 102 115 103 116 for (int i = 0; i < NumNodes; i++) { … … 130 143 131 144 while (elapsed_sec <= (double) ExperimentDurSec && bobs_ops_completed < ExperimentDurOpCount) { 132 for ( int t = 0; t < Check ClockFreq; t += 1 ) {145 for ( int t = 0; t < CheckDoneFreq; t += 1 ) { 133 146 TRACE('a') 134 147 listedItems[0] = … … 166 179 TRACE('g') 167 180 } 181 #ifndef DISABLE_CLOCK_RECHECK 182 clock_t end = clock(); 183 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC); 184 #endif 185 } 186 #ifdef DISABLE_CLOCK_RECHECK 187 { 168 188 clock_t end = clock(); 169 189 elapsed_sec = ((double)(end - start)) / ((double)CLOCKS_PER_SEC); 170 190 } 191 #endif 171 192 172 193 double mean_op_dur_ns = elapsed_sec / ((double)bobs_ops_completed) * 1000 * 1000 * 1000;
Note: See TracChangeset
for help on using the changeset viewer.