| 1 | # For correctness, see test-correctness.sh.
|
|---|
| 2 | # For performance, example:
|
|---|
| 3 | # pushd ~/cfax
|
|---|
| 4 | # . ~/setcfa build-fast
|
|---|
| 5 | # popd
|
|---|
| 6 | # make perfprogs CFA=$cfa -j8 MODE=performance
|
|---|
| 7 | # make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=common5
|
|---|
| 8 | # cp results-latest.csv results-baseline.csv
|
|---|
| 9 | # For performance, see also: `results-smoketest.csv`, `make thesis`, and more such applied targets at the end
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | CFA ?= cfa
|
|---|
| 13 | CC = gcc-11
|
|---|
| 14 | CXX = g++-11
|
|---|
| 15 | UXX ?= ~/usys1/uCPP/source/bin/u++
|
|---|
| 16 |
|
|---|
| 17 | hi:
|
|---|
| 18 | echo $(CC)
|
|---|
| 19 | echo $(CXX)
|
|---|
| 20 |
|
|---|
| 21 | MODE?=performance
|
|---|
| 22 | EXTRA_COMP_FLAGS?=
|
|---|
| 23 | RUN_NUM_REPS?=3
|
|---|
| 24 | RUN_DATA_SIZE_MODE?=none
|
|---|
| 25 | RUN_DURATION_SEC?=5
|
|---|
| 26 | RUN_TASKSET_CPULIST?=6
|
|---|
| 27 |
|
|---|
| 28 | LLHEAP_LIB=../llheap/libllheap.so
|
|---|
| 29 |
|
|---|
| 30 | CFA_PERFMODE_DEBUG_FLAG?=-nodebug
|
|---|
| 31 |
|
|---|
| 32 | ifeq "$(MODE)" "performance"
|
|---|
| 33 | PERFFLAGS_CFA = -DNDEBUG -O3 $(CFA_PERFMODE_DEBUG_FLAG)
|
|---|
| 34 | PERFFLAGS_CC = -DNDEBUG -O3
|
|---|
| 35 | else ifeq "$(MODE)" "correctness"
|
|---|
| 36 | PERFFLAGS_CFA = -O0 -g
|
|---|
| 37 | PERFFLAGS_CC = -O0 -g
|
|---|
| 38 | else
|
|---|
| 39 | $(error Bad MODE ($(MODE)); should be performance or correctness)
|
|---|
| 40 | endif
|
|---|
| 41 |
|
|---|
| 42 | PERFFLAGS_CXX = $(PERFFLAGS_CC)
|
|---|
| 43 | PERFFLAGS_UXX = $(PERFFLAGS_CFA)
|
|---|
| 44 |
|
|---|
| 45 | CFLAGS=$(PERFFLAGS_CC) $(EXTRA_COMP_FLAGS)
|
|---|
| 46 |
|
|---|
| 47 | SHELL = /usr/bin/bash
|
|---|
| 48 |
|
|---|
| 49 | # function: project an element from a filename that contains a delimited tuple
|
|---|
| 50 | # (call proj,-,a-b-c.hfa,3)
|
|---|
| 51 | # is
|
|---|
| 52 | # c
|
|---|
| 53 | define proj
|
|---|
| 54 | $(word $(3),$(subst $(1), ,$(basename $(2))))
|
|---|
| 55 | endef
|
|---|
| 56 |
|
|---|
| 57 | # functions: cross two lists, adding given delimiter between
|
|---|
| 58 | # (call cross,-,a b c,1 2)
|
|---|
| 59 | # is
|
|---|
| 60 | # a-1 a-2 b-1 b-2 c-1 c-2
|
|---|
| 61 | define cross
|
|---|
| 62 | $(foreach x,$(2),$(foreach xs,$(3),$(x)$(1)$(xs)))
|
|---|
| 63 | endef
|
|---|
| 64 | define cross3
|
|---|
| 65 | $(call cross,$(1),$(2),$(call cross,$(1),$(3),$(4)))
|
|---|
| 66 | endef
|
|---|
| 67 | define cross4
|
|---|
| 68 | $(call cross,$(1),$(2),$(call cross3,$(1),$(3),$(4),$(5)))
|
|---|
| 69 | endef
|
|---|
| 70 | define cross5
|
|---|
| 71 | $(call cross,$(1),$(2),$(call cross4,$(1),$(3),$(4),$(5),$(6)))
|
|---|
| 72 | endef
|
|---|
| 73 |
|
|---|
| 74 | OP_MOVEMENTS?=stack queue
|
|---|
| 75 | OP_POLARITIES?=insfirst inslast
|
|---|
| 76 | OP_ACCESSORS?=allhead inselem remelem
|
|---|
| 77 | RUN_INTERLEAVE_PCTS?=0
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 | FX_SOLUTIONS?=lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref
|
|---|
| 81 |
|
|---|
| 82 | OPS=$(call cross3,-,$(OP_MOVEMENTS),$(OP_POLARITIES),$(OP_ACCESSORS))
|
|---|
| 83 | FXS=$(FX_SOLUTIONS)
|
|---|
| 84 |
|
|---|
| 85 | all : perfprogs results-latest.csv
|
|---|
| 86 |
|
|---|
| 87 | # Want to add functional dependency:
|
|---|
| 88 | # if current FX_SOLUTION is lq-list then
|
|---|
| 89 | # current OP_MOVEMENT must be stack and
|
|---|
| 90 | # current OP_POLARITY must be insfirst
|
|---|
| 91 | LQ_LIST_INCOMPAT_OP_MOVEMENTS=$(filter-out stack,$(OP_MOVEMENTS))
|
|---|
| 92 | LQ_LIST_INCOMPAT_OP_POLARITIES=$(filter-out insfirst,$(OP_POLARITIES))
|
|---|
| 93 | LQ_LIST_INCOMPAT_OPS=$(call cross3,-,$(LQ_LIST_INCOMPAT_OP_MOVEMENTS),$(OP_POLARITIES),$(OP_ACCESSORS)) \
|
|---|
| 94 | $(call cross3,-,$(OP_MOVEMENTS),$(LQ_LIST_INCOMPAT_OP_POLARITIES),$(OP_ACCESSORS))
|
|---|
| 95 | INCOMPAT=$(call cross,--,lq-list,$(LQ_LIST_INCOMPAT_OPS))
|
|---|
| 96 | define filterFds
|
|---|
| 97 | $(filter-out $(INCOMPAT),$(1))
|
|---|
| 98 | endef
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 | CORES_FULL=$(call cross,--,$(FXS),$(OPS)) # lq-tailq--stack-inslast-allhead
|
|---|
| 102 | CORES=$(call filterFds,$(CORES_FULL)) # lq-tailq--stack-inslast-allhead
|
|---|
| 103 |
|
|---|
| 104 | .SECONDEXPANSION: # allow $$ expansion for dynamic dependencies
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 | PERFPROGS=$(call cross,--,perfexp,$(CORES))
|
|---|
| 108 |
|
|---|
| 109 | perfprogs : $(PERFPROGS)
|
|---|
| 110 |
|
|---|
| 111 | perfexp--% driver--%.o result--%.1csv : FX=$(call proj,--,$@,2)
|
|---|
| 112 | perfexp--% driver--%.o result--%.1csv : FX_COARSE=$(call proj,-,$(FX),1)
|
|---|
| 113 | perfexp--% driver--%.o result--%.1csv : OP=$(call proj,--,$@,3)
|
|---|
| 114 | perfexp--% driver--%.o result--%.1csv : OP_MOVEMENT=$(call proj,-,$(OP),1)
|
|---|
| 115 | perfexp--% driver--%.o result--%.1csv : OP_POLARITY=$(call proj,-,$(OP),2)
|
|---|
| 116 | perfexp--% driver--%.o result--%.1csv : OP_ACCESSOR=$(call proj,-,$(OP),3)
|
|---|
| 117 | perfexp--% driver--%.o result--%.1csv : OP_DEFINES=-DOP_MOVEMENT=$(OP_MOVEMENT) -DOP_POLARITY=$(OP_POLARITY) -DOP_ACCESSOR=$(OP_ACCESSOR)
|
|---|
| 118 |
|
|---|
| 119 | perfexp--cfa-% driver--cfa-%.o : COMPILER=$(CFA) $(PERFFLAGS_CFA)
|
|---|
| 120 | perfexp--lq-% driver--lq-%.o : COMPILER=$(CC) $(PERFFLAGS_CC)
|
|---|
| 121 | perfexp--cpp-% driver--cpp-%.o : COMPILER=$(CXX) $(PERFFLAGS_CXX)
|
|---|
| 122 | perfexp--upp-% driver--upp-%.o : COMPILER=$(UXX) $(PERFFLAGS_UXX)
|
|---|
| 123 | perfexp--% driver--%.o : COMPILER=NO-COMPILER-FOR-$(FX_COARSE)
|
|---|
| 124 |
|
|---|
| 125 | USE_LLHEAP=no
|
|---|
| 126 | perfexp--cpp-% driver--cpp-%.o : USE_LLHEAP=yes
|
|---|
| 127 | perfexp--cpp-%AllocGlib driver--cpp-%AllocGlib.o : USE_LLHEAP=no
|
|---|
| 128 |
|
|---|
| 129 | LLHEAP_LIB_COND=$(if $(filter $(USE_LLHEAP),yes),$(LLHEAP_LIB))
|
|---|
| 130 | LLHEAP_PRELOAD_COND=$(if $(filter $(USE_LLHEAP),yes),LD_PRELOAD=$(LLHEAP_LIB))
|
|---|
| 131 |
|
|---|
| 132 | $(dir $(LLHEAP_LIB)) :
|
|---|
| 133 | $(error Manual action required: clone llheap into $@)
|
|---|
| 134 |
|
|---|
| 135 | $(LLHEAP_LIB) : $$(dir $$@)
|
|---|
| 136 | $(MAKE) -C $< $(notdir $@)
|
|---|
| 137 |
|
|---|
| 138 | # Without this %.d rule, ordinary make runs have noise about the recipe for driver--%.o being ill-formed when called on a *.d.
|
|---|
| 139 | # https://stackoverflow.com/questions/3714041/why-does-this-makefile-execute-a-target-on-make-clean
|
|---|
| 140 | # Whatever you -include gets called as a target first.
|
|---|
| 141 | # One such example is driver--upp-upp--stack-insfirst-allhead.d
|
|---|
| 142 | # Without this %.d rule, `make make driver--upp-upp--stack-insfirst-allhead.d` leads to the rule for driver--%.o firing.
|
|---|
| 143 | # Though my dumb human eyes don't see the pattern as matching.
|
|---|
| 144 | %.d:
|
|---|
| 145 | @touch $@
|
|---|
| 146 |
|
|---|
| 147 | ifeq "$(MAKE_DISABLE_OBSERVATION)" "yes"
|
|---|
| 148 | OBSERVATION_COMP_FLAG= -DDISABLE_OBSERVATION
|
|---|
| 149 | OBSERVATION_OBJ_COND=
|
|---|
| 150 | else
|
|---|
| 151 | OBSERVATION_COMP_FLAG=
|
|---|
| 152 | OBSERVATION_OBJ_COND= observation.o
|
|---|
| 153 | endif
|
|---|
| 154 |
|
|---|
| 155 | perfexp--% : $$(LLHEAP_LIB_COND) driver--%.o $(OBSERVATION_OBJ_COND)
|
|---|
| 156 | $(COMPILER) $(EXTRA_COMP_FLAGS) $^ -o $@
|
|---|
| 157 |
|
|---|
| 158 | driver--%.o : driver.c
|
|---|
| 159 | $(COMPILER) $(EXTRA_COMP_FLAGS) $(OBSERVATION_COMP_FLAG) -c $< $(OP_DEFINES) -include op-$(OP).h -include fx-$(FX).h -o $@ -MMD
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 | # troubleshooting, e.g. `make echo_DEMOS` runs `echo $(DEMOS)`
|
|---|
| 163 | echo_% :
|
|---|
| 164 | @echo '$($(@:echo_%=%))'
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 | ifeq "$(RUN_DATA_SIZE_MODE)" "manual"
|
|---|
| 168 | ifeq "$(RUN_DATA_SIZES)" ""
|
|---|
| 169 | $(error RUN_DATA_SIZE_MODE is manual but RUN_DATA_SIZES not given)
|
|---|
| 170 | endif
|
|---|
| 171 | endif
|
|---|
| 172 |
|
|---|
| 173 | RUN_DATA_SIZES = \
|
|---|
| 174 | $(if $(filter $(RUN_DATA_SIZE_MODE),common5), \
|
|---|
| 175 | 7-1000000 \
|
|---|
| 176 | 71-100000 \
|
|---|
| 177 | 809-10000 \
|
|---|
| 178 | 9051-1000 \
|
|---|
| 179 | 72421-100 \
|
|---|
| 180 | , $(if $(filter $(RUN_DATA_SIZE_MODE),thorough), \
|
|---|
| 181 | 1-1000000 \
|
|---|
| 182 | 2-1000000 \
|
|---|
| 183 | 3-1000000 \
|
|---|
| 184 | 5-1000000 \
|
|---|
| 185 | 7-1000000 \
|
|---|
| 186 | 11-100000 \
|
|---|
| 187 | 13-100000 \
|
|---|
| 188 | 19-100000 \
|
|---|
| 189 | 29-100000 \
|
|---|
| 190 | 37-100000 \
|
|---|
| 191 | 53-100000 \
|
|---|
| 192 | 71-100000 \
|
|---|
| 193 | 101-10000 \
|
|---|
| 194 | 149-10000 \
|
|---|
| 195 | 211-10000 \
|
|---|
| 196 | 283-10000 \
|
|---|
| 197 | 401-10000 \
|
|---|
| 198 | 569-10000 \
|
|---|
| 199 | 809-10000 \
|
|---|
| 200 | 1151-1000 \
|
|---|
| 201 | 1601-1000 \
|
|---|
| 202 | 2267-1000 \
|
|---|
| 203 | 3203-1000 \
|
|---|
| 204 | 4547-1000 \
|
|---|
| 205 | 6473-1000 \
|
|---|
| 206 | 9051-1000 \
|
|---|
| 207 | 12809-100 \
|
|---|
| 208 | 18119-100 \
|
|---|
| 209 | 25601-100 \
|
|---|
| 210 | 36209-100 \
|
|---|
| 211 | 51203-100 \
|
|---|
| 212 | 72421-100 \
|
|---|
| 213 | 102407-10 \
|
|---|
| 214 | 144817-10 \
|
|---|
| 215 | 204803-10 \
|
|---|
| 216 | 289637-10 \
|
|---|
| 217 | 409609-10 \
|
|---|
| 218 | 579263-10 \
|
|---|
| 219 | 819229-10 \
|
|---|
| 220 | 1158613-1 \
|
|---|
| 221 | 1638431-1 \
|
|---|
| 222 | 2317057-1 \
|
|---|
| 223 | 3276803-1 \
|
|---|
| 224 | 4634111-1 \
|
|---|
| 225 | 6553621-1 \
|
|---|
| 226 | 9268211-1 \
|
|---|
| 227 | , $(if $(filter $(RUN_DATA_SIZE_MODE),bignquick), \
|
|---|
| 228 | 3-1000000 \
|
|---|
| 229 | 29-100000 \
|
|---|
| 230 | 283-10000 \
|
|---|
| 231 | 3203-1000 \
|
|---|
| 232 | 25601-100 \
|
|---|
| 233 | 289637-10 \
|
|---|
| 234 | 1000000-1 \
|
|---|
| 235 | 3276803-1 \
|
|---|
| 236 | 10000000-1 \
|
|---|
| 237 | , $(if $(filter $(RUN_DATA_SIZE_MODE),bignthorough), \
|
|---|
| 238 | 1-1000000 \
|
|---|
| 239 | 3-1000000 \
|
|---|
| 240 | 7-1000000 \
|
|---|
| 241 | 13-100000 \
|
|---|
| 242 | 29-100000 \
|
|---|
| 243 | 53-100000 \
|
|---|
| 244 | 101-10000 \
|
|---|
| 245 | 211-10000 \
|
|---|
| 246 | 401-10000 \
|
|---|
| 247 | 809-10000 \
|
|---|
| 248 | 1601-1000 \
|
|---|
| 249 | 3203-1000 \
|
|---|
| 250 | 6473-1000 \
|
|---|
| 251 | 12809-100 \
|
|---|
| 252 | 25601-100 \
|
|---|
| 253 | 51203-100 \
|
|---|
| 254 | 102407-10 \
|
|---|
| 255 | 204803-10 \
|
|---|
| 256 | 409609-10 \
|
|---|
| 257 | 819229-10 \
|
|---|
| 258 | 1638431-1 \
|
|---|
| 259 | 3276803-1 \
|
|---|
| 260 | 6553621-1 \
|
|---|
| 261 | 12809000-1 \
|
|---|
| 262 | 25601000-1 \
|
|---|
| 263 | 51203000-1 \
|
|---|
| 264 | 102407000-1 \
|
|---|
| 265 | 204803000-1 \
|
|---|
| 266 | 409609000-1 \
|
|---|
| 267 | , $(if $(filter $(RUN_DATA_SIZE_MODE),moderate), \
|
|---|
| 268 | 1-1000000 \
|
|---|
| 269 | 3-1000000 \
|
|---|
| 270 | 7-1000000 \
|
|---|
| 271 | 13-100000 \
|
|---|
| 272 | 29-100000 \
|
|---|
| 273 | 53-100000 \
|
|---|
| 274 | 101-10000 \
|
|---|
| 275 | 211-10000 \
|
|---|
| 276 | 401-10000 \
|
|---|
| 277 | 1601-1000 \
|
|---|
| 278 | 6473-1000 \
|
|---|
| 279 | 25601-100 \
|
|---|
| 280 | , $(if $(filter $(RUN_DATA_SIZE_MODE),sweetspot), \
|
|---|
| 281 | 1-1000000 \
|
|---|
| 282 | 2-1000000 \
|
|---|
| 283 | 3-1000000 \
|
|---|
| 284 | 5-1000000 \
|
|---|
| 285 | 7-1000000 \
|
|---|
| 286 | 11-100000 \
|
|---|
| 287 | 13-100000 \
|
|---|
| 288 | 19-100000 \
|
|---|
| 289 | 29-100000 \
|
|---|
| 290 | 37-100000 \
|
|---|
| 291 | 53-100000 \
|
|---|
| 292 | 71-100000 \
|
|---|
| 293 | 101-10000 \
|
|---|
| 294 | 149-10000 \
|
|---|
| 295 | , $(if $(filter $(RUN_DATA_SIZE_MODE),peter), \
|
|---|
| 296 | 4-1000000 \
|
|---|
| 297 | 8-1000000 \
|
|---|
| 298 | 16-100000 \
|
|---|
| 299 | 32-100000 \
|
|---|
| 300 | 64-100000 \
|
|---|
| 301 | 128-10000 \
|
|---|
| 302 | 256-10000 \
|
|---|
| 303 | 512-10000 \
|
|---|
| 304 | 1024-1000 \
|
|---|
| 305 | 2048-1000 \
|
|---|
| 306 | 4096-1000 \
|
|---|
| 307 | 8192-1000 \
|
|---|
| 308 | 16384-100 \
|
|---|
| 309 | 32768-100 \
|
|---|
| 310 | 65536-100 \
|
|---|
| 311 | 131072-10 \
|
|---|
| 312 | 262144-10 \
|
|---|
| 313 | 524288-10 \
|
|---|
| 314 | 1048576-1 \
|
|---|
| 315 | 2097152-1 \
|
|---|
| 316 | 4194304-1 \
|
|---|
| 317 | 8388608-1 \
|
|---|
| 318 | 16777216-1 \
|
|---|
| 319 | , $(if $(filter $(RUN_DATA_SIZE_MODE),peterhuge), \
|
|---|
| 320 | 16777216-1 \
|
|---|
| 321 | 33554432-1 \
|
|---|
| 322 | 67108864-1 \
|
|---|
| 323 | 134217728-1 \
|
|---|
| 324 | , $(if $(filter $(RUN_DATA_SIZE_MODE),none), \
|
|---|
| 325 | , $(error Bad RUN_DATA_SIZE_MODE ($(RUN_DATA_SIZE_MODE)); see list of accepted values in Makefile's RUN_DATA_SIZES defimition) \
|
|---|
| 326 | )))))))))
|
|---|
| 327 |
|
|---|
| 328 | # removed from peterhuge
|
|---|
| 329 | # 268435456-1 \
|
|---|
| 330 | # 536870912-1 \
|
|---|
| 331 | # 1073741824-1 \
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 | RUN_REP_IDS=$(shell echo {1..$(RUN_NUM_REPS)}) # 1 2 3
|
|---|
| 335 | RUN_REP_EXTS=$(call cross3,,run,$(RUN_REP_IDS),.1csv) # run1.1csv run2.1csv run3.1csv
|
|---|
| 336 |
|
|---|
| 337 | RUN_LAUNCHES=$(call cross3,--,$(RUN_DATA_SIZES),$(RUN_INTERLEAVE_PCTS),$(RUN_REP_EXTS))
|
|---|
| 338 |
|
|---|
| 339 |
|
|---|
| 340 | RESULT1S=$(call cross,.,$(CORES),$(RUN_LAUNCHES)) # lq-tailq--stack-inslast-allhead.run2.1csv
|
|---|
| 341 |
|
|---|
| 342 |
|
|---|
| 343 | RESULT1S_SHUFD=$(shell shuf -e $(RESULT1S))
|
|---|
| 344 |
|
|---|
| 345 | %.1csv : CORE=$(basename $(basename $@))
|
|---|
| 346 | %.1csv : LAUNCH=$(subst .,,$(suffix $(basename $@)))
|
|---|
| 347 | %.1csv : SIZING=$(call proj,--,$(LAUNCH),1)
|
|---|
| 348 | %.1csv : NUMNODES=$(call proj,-,$(SIZING),1)
|
|---|
| 349 | %.1csv : CHECKDONE=$(call proj,-,$(SIZING),2)
|
|---|
| 350 | %.1csv : RUN_INTERLEAVE_PCT=$(call proj,--,$(LAUNCH),2)
|
|---|
| 351 | %.1csv : RUN_INTERLEAVE_FRAC=$(shell echo "scale=2; $(RUN_INTERLEAVE_PCT) / 100" | bc)
|
|---|
| 352 | %.1csv : REP_ID=$(subst run,,$(call proj,--,$(LAUNCH),3))
|
|---|
| 353 | %.1csv : SEED=$(REP_ID)
|
|---|
| 354 | %.1csv : RUN_ARGS=$(if $(filter none,$(SIZING)),,$(RUN_DURATION_SEC) $(CHECKDONE) $(NUMNODES) -1 $(SEED) $(RUN_INTERLEAVE_FRAC)) # use REP_ID as seed
|
|---|
| 355 | %.1csv : REP_TIME=$(shell date '+%F %H:%M:%S')
|
|---|
| 356 | %.1csv : FX=$(call proj,--,$(CORE),1)
|
|---|
| 357 | %.1csv : IS_CPP=$(filter cpp-%,$(FX))
|
|---|
| 358 | %.1csv : IS_NOT_EXPLICIT_GLIB=$(filter-out %AllocGlib,$(FX))
|
|---|
| 359 | %.1csv : USE_LLHEAP=$(if $(and $(IS_CPP),$(IS_NOT_EXPLICIT_GLIB)),yes,no)
|
|---|
| 360 | %.1csv : perfprogs FORCE
|
|---|
| 361 | # @echo $(FX) $(IS_CPP) $(IS_NOT_EXPLICIT_GLIB) $(USE_LLHEAP) $(LLHEAP_PRELOAD_COND)
|
|---|
| 362 | taskset --cpu-list $(RUN_TASKSET_CPULIST) sh -c '$(LLHEAP_PRELOAD_COND) ./perfexp--$(CORE) $(RUN_ARGS)' | xargs -n 1 printf '%s,%s,%s,%s\n' "$(REP_TIME)" "$(REP_ID)" "$(RUN_ARGS)" | tee -a $(RESULT)
|
|---|
| 363 |
|
|---|
| 364 | # := for evaluate once and save
|
|---|
| 365 | # = for letting cmdline override
|
|---|
| 366 | BATCHTIME:=$(shell date '+%F--%H-%M-%S')
|
|---|
| 367 | RESULT=results--$(BATCHTIME).csv
|
|---|
| 368 |
|
|---|
| 369 | sub_make=$(MAKE) --no-print-directory $(1); cat $(1) >> $(2); rm $(1);
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 | export RESULT1S_SHUFD # used by sh loop in $(RESULT) recipe
|
|---|
| 373 | export RUN_DURATION_SEC # used by sub make; occurs free in %.1csv's variable bindings (not extracted from target name)
|
|---|
| 374 |
|
|---|
| 375 |
|
|---|
| 376 | NTESTS=$(words $(RESULT1S_SHUFD))
|
|---|
| 377 | RUNDUR = $(shell expr $(NTESTS) \* $(RUN_DURATION_SEC))
|
|---|
| 378 | ETA = $(shell date -d "+$(RUNDUR) seconds" +"%H:%M:%S")
|
|---|
| 379 |
|
|---|
| 380 | $(RESULT) :
|
|---|
| 381 | @echo running $(NTESTS) tests, eta $(ETA)
|
|---|
| 382 | for r in $$RESULT1S_SHUFD; do $(MAKE) --no-print-directory RESULT=$(RESULT) $$r; done
|
|---|
| 383 |
|
|---|
| 384 | results-latest.csv : $(RESULT)
|
|---|
| 385 | rm -f $@
|
|---|
| 386 | ln -s $< $@
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 | clean :
|
|---|
| 391 | rm -f *.o *.d perfexp--*
|
|---|
| 392 |
|
|---|
| 393 | # The FORCE business means any target that mentions it is also phony
|
|---|
| 394 | # https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html says: To always rebuild a pattern rule consider using a “force target” (see [https://www.gnu.org/software/make/manual/html_node/Force-Targets.html]).
|
|---|
| 395 | .PHONY: all perfprogs results-latest.csv clean
|
|---|
| 396 | FORCE:
|
|---|
| 397 |
|
|---|
| 398 | .PRECIOUS: result--%.1csv driver--%.o perfexp--% %.o
|
|---|
| 399 |
|
|---|
| 400 | -include *.d
|
|---|
| 401 |
|
|---|
| 402 | results-general.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 403 | results-general.csv: EXTRA_COMP_FLAGS+= -DDISABLE_INTERLEAVING
|
|---|
| 404 | results-general.csv: FORCE cleanbuild
|
|---|
| 405 | rm -f $@
|
|---|
| 406 | $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_REP_IDS=1 RUN_DATA_SIZE_MODE=sweetspot RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref' MAKE_DISABLE_OBSERVATION=yes EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 407 | cat results-latest.csv >> $@
|
|---|
| 408 | $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_REP_IDS=2 RUN_DATA_SIZE_MODE=sweetspot RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref' MAKE_DISABLE_OBSERVATION=yes EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 409 | cat results-latest.csv >> $@
|
|---|
| 410 | $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_REP_IDS=3 RUN_DATA_SIZE_MODE=sweetspot RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref' MAKE_DISABLE_OBSERVATION=yes EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 411 | cat results-latest.csv >> $@
|
|---|
| 412 | $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_REP_IDS=4 RUN_DATA_SIZE_MODE=sweetspot RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref' MAKE_DISABLE_OBSERVATION=yes EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 413 | cat results-latest.csv >> $@
|
|---|
| 414 | $(MAKE) results-latest.csv RUN_DURATION_SEC=5 RUN_REP_IDS=5 RUN_DATA_SIZE_MODE=sweetspot RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq lq-list cfa-cfa cfa-mandHead cfa-noListed cfa-noIter cfa-likeLq cfa-strip upp-upp cpp-stlref' MAKE_DISABLE_OBSERVATION=yes EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 415 | cat results-latest.csv >> $@
|
|---|
| 416 |
|
|---|
| 417 | SHORT_SEMIPERIM=7
|
|---|
| 418 |
|
|---|
| 419 | results-short-once.phony: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 420 | results-short-once.phony: LEN_LIMIT=$(strip $(shell echo $$(($(SHORT_SEMIPERIM)-$(WIDTH)+1))))
|
|---|
| 421 | results-short-once.phony: LEN_VALS=$(strip $(shell echo {1..$(LEN_LIMIT)}))
|
|---|
| 422 | results-short-once.phony: RUN_DATA_SIZES= $(call cross,-,$(LEN_VALS),1000000)
|
|---|
| 423 | results-short-once.phony: EXTRA_COMP_FLAGS+= -DDISABLE_INTERLEAVING -DWIDTH=$(WIDTH)
|
|---|
| 424 | results-short-once.phony: FX_SOLUTIONS=lq-tailq cfa-cfa
|
|---|
| 425 | results-short-once.phony: OP_MOVEMENTS=queue
|
|---|
| 426 | results-short-once.phony: OP_ACCESSORS=allhead
|
|---|
| 427 | results-short-once.phony: FORCE cleanbuild
|
|---|
| 428 | $(MAKE) results-latest.csv RUN_DATA_SIZE_MODE=manual RUN_DATA_SIZES="$(RUN_DATA_SIZES)" RUN_INTERLEAVE_PCTS='0' FX_SOLUTIONS='lq-tailq cfa-cfa' EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING OP_MOVEMENTS=queue OP_ACCESSORS=allhead MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 429 |
|
|---|
| 430 | results-short.csv: FORCE
|
|---|
| 431 | rm -f $@
|
|---|
| 432 | for i in {1..$(SHORT_SEMIPERIM)}; do $(MAKE) results-short-once.phony WIDTH=$$i; cat results-latest.csv >> $@; done
|
|---|
| 433 |
|
|---|
| 434 | results-zoomout-noshuf.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 435 | results-zoomout-noshuf.csv: EXTRA_COMP_FLAGS+= -DTINY_USER_ITEMS -DDISABLE_INTERLEAVING -DDISABLE_ITERS
|
|---|
| 436 | results-zoomout-noshuf.csv: OP_MOVEMENTS=stack
|
|---|
| 437 | results-zoomout-noshuf.csv: OP_POLARITIES=insfirst
|
|---|
| 438 | results-zoomout-noshuf.csv: OP_ACCESSORS=allhead
|
|---|
| 439 | results-zoomout-noshuf.csv: FORCE cleanbuild
|
|---|
| 440 | make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=bignthorough OPS=stack-insfirst-allhead FX_SOLUTIONS='lq-tailq cfa-cfa upp-upp cpp-stlref lq-list' SEED=-1
|
|---|
| 441 | cp results-latest.csv $@
|
|---|
| 442 |
|
|---|
| 443 | results-zoomout-shuf.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 444 | results-zoomout-shuf.csv: EXTRA_COMP_FLAGS+= -DTINY_USER_ITEMS -DDISABLE_INTERLEAVING -DDISABLE_ITERS
|
|---|
| 445 | results-zoomout-shuf.csv: OP_MOVEMENTS=stack
|
|---|
| 446 | results-zoomout-shuf.csv: OP_POLARITIES=insfirst
|
|---|
| 447 | results-zoomout-shuf.csv: OP_ACCESSORS=allhead
|
|---|
| 448 | results-zoomout-shuf.csv: FORCE cleanbuild
|
|---|
| 449 | make results-latest.csv RUN_DURATION_SEC=5 RUN_NUM_REPS=5 RUN_DATA_SIZE_MODE=bignthorough OPS=stack-insfirst-allhead FX_SOLUTIONS='lq-tailq cfa-cfa upp-upp cpp-stlref lq-list'
|
|---|
| 450 | cp results-latest.csv $@
|
|---|
| 451 |
|
|---|
| 452 | results-manual.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 453 | results-manual.csv: EXTRA_COMP_FLAGS+= -DTINY_USER_ITEMS -DDISABLE_INTERLEAVING -DDISABLE_ITERS
|
|---|
| 454 | results-manual.csv: OP_MOVEMENTS=stack
|
|---|
| 455 | results-manual.csv: OP_POLARITIES=insfirst
|
|---|
| 456 | results-manual.csv: OP_ACCESSORS=allhead
|
|---|
| 457 | results-manual.csv: FX_SOLUTIONS=cpp-stlref
|
|---|
| 458 | results-manual.csv: RUN_DATA_SIZE_MODE=peterhuge
|
|---|
| 459 | results-manual.csv: FORCE cleanbuild
|
|---|
| 460 | make results-latest.csv RUN_DURATION_SEC=3 RUN_NUM_REPS=1 RUN_DATA_SIZE_MODE='$(RUN_DATA_SIZE_MODE)' OPS='$(OPS)' FX_SOLUTIONS='$(FX_SOLUTIONS)'
|
|---|
| 461 | cp results-latest.csv $@
|
|---|
| 462 |
|
|---|
| 463 | thesis:
|
|---|
| 464 | $(MAKE) results-general.csv
|
|---|
| 465 | $(MAKE) results-zoomout-noshuf.csv
|
|---|
| 466 | $(MAKE) results-zoomout-shuf.csv
|
|---|
| 467 |
|
|---|
| 468 | results-smoketest.csv: RUN_DATA_SIZE_MODE=bignquick
|
|---|
| 469 | results-smoketest.csv: RUN_NUM_REPS=1
|
|---|
| 470 | results-smoketest.csv: RUN_DURATION_SEC=1
|
|---|
| 471 | results-smoketest.csv: OP_MOVEMENTS=stack
|
|---|
| 472 | results-smoketest.csv: OP_POLARITIES=insfirst
|
|---|
| 473 | results-smoketest.csv: OP_ACCESSORS=allhead
|
|---|
| 474 | results-smoketest.csv: EXTRA_COMP_FLAGS+= -DDISABLE_INTERLEAVING
|
|---|
| 475 | results-smoketest.csv: $(RESULT)
|
|---|
| 476 | mv $< $@
|
|---|
| 477 |
|
|---|
| 478 | CPUS_AVAIL=8
|
|---|
| 479 |
|
|---|
| 480 | export RUN_DATA_SIZE_MODE
|
|---|
| 481 | export RUN_NUM_REPS
|
|---|
| 482 | export RUN_DURATION_SEC
|
|---|
| 483 | export OP_MOVEMENTS
|
|---|
| 484 | export OP_POLARITIES
|
|---|
| 485 | export OP_ACCESSORS
|
|---|
| 486 | export EXTRA_COMP_FLAGS
|
|---|
| 487 | export FX_SOLUTIONS
|
|---|
| 488 | export MAKE_DISABLE_OBSERVATION
|
|---|
| 489 | export WIDTH
|
|---|
| 490 | export EXTRA_COMP_FLAGS
|
|---|
| 491 |
|
|---|
| 492 | cleanbuild: FORCE clean
|
|---|
| 493 | $(MAKE) -j $(CPUS_AVAIL) perfprogs
|
|---|
| 494 |
|
|---|
| 495 | # equivalents to peter's tests
|
|---|
| 496 |
|
|---|
| 497 | peter-all:
|
|---|
| 498 | $(MAKE) results-peter-linear.csv
|
|---|
| 499 | $(MAKE) results-peter-random2.csv
|
|---|
| 500 | $(MAKE) results-peter-removeHere.csv
|
|---|
| 501 | $(MAKE) results-peter-xlinear.csv
|
|---|
| 502 | $(MAKE) results-peter-xrandom2.csv
|
|---|
| 503 | $(MAKE) results-peter-xremoveHere.csv
|
|---|
| 504 |
|
|---|
| 505 | # debatable FX_SOLUTIONS using cfa-cfa or cfa-mandhead
|
|---|
| 506 | # cfa-cfa faster on allhead (so I thought from thesis analysis; doubting that now under minimal harness), slower on remelem
|
|---|
| 507 | # cfa-mandhead IS what Peter's using
|
|---|
| 508 | results-peter-%.csv: RUN_DATA_SIZE_MODE=peter
|
|---|
| 509 | results-peter-%.csv: RUN_NUM_REPS=3
|
|---|
| 510 | results-peter-%.csv: RUN_DURATION_SEC=3
|
|---|
| 511 | results-peter-%.csv: OP_MOVEMENTS=stack
|
|---|
| 512 | results-peter-%.csv: OP_POLARITIES=insfirst
|
|---|
| 513 | results-peter-%.csv: OP_ACCESSORS=allhead
|
|---|
| 514 | results-peter-%.csv: FX_SOLUTIONS=cfa-mandHead cpp-stlref cpp-stlrefAllocGlib
|
|---|
| 515 | results-peter-%.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 516 | results-peter-%.csv: cleanbuild $(RESULT)
|
|---|
| 517 | mv $(RESULT) $@
|
|---|
| 518 |
|
|---|
| 519 | results-peter-linear.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_SHUFFLING_INDIRECTION -DDISABLE_ITERS
|
|---|
| 520 | results-peter-xlinear.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 521 |
|
|---|
| 522 | results-peter-random2.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_ITERS
|
|---|
| 523 | results-peter-xrandom2.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 524 |
|
|---|
| 525 | results-peter-removeHere.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_SHUFFLING_INDIRECTION
|
|---|
| 526 | results-peter-removeHere.csv: OP_ACCESSORS=remelem
|
|---|
| 527 | results-peter-xremoveHere.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|
| 528 | results-peter-xremoveHere.csv: OP_ACCESSORS=remelem
|
|---|
| 529 |
|
|---|
| 530 | peter-summary.txt: FORCE
|
|---|
| 531 | rm -f $@
|
|---|
| 532 | printf '#size\tmean\tstd\tmin\tmax\tntrials\tignore\tignore\n' >> $@
|
|---|
| 533 | echo >> $@
|
|---|
| 534 | for f in results-peter*.csv; do echo -------------- $$f ---------------- >> $@; python3 qplot.py $$f >> $@; done
|
|---|
| 535 |
|
|---|
| 536 |
|
|---|
| 537 |
|
|---|
| 538 |
|
|---|
| 539 | fred-all:
|
|---|
| 540 | $(MAKE) results-fred-linear.csv
|
|---|
| 541 | $(MAKE) results-fred-shuf.csv
|
|---|
| 542 | $(MAKE) results-fred-iters.csv
|
|---|
| 543 | $(MAKE) results-fred-thesis.csv
|
|---|
| 544 |
|
|---|
| 545 | results-fred-%.csv: RUN_DATA_SIZE_MODE=peter
|
|---|
| 546 | results-fred-%.csv: RUN_NUM_REPS=3
|
|---|
| 547 | results-fred-%.csv: RUN_DURATION_SEC=3
|
|---|
| 548 | results-fred-%.csv: OP_MOVEMENTS=stack queue
|
|---|
| 549 | results-fred-%.csv: OP_POLARITIES=insfirst
|
|---|
| 550 | results-fred-%.csv: OP_ACCESSORS=allhead
|
|---|
| 551 | results-fred-%.csv: FX_SOLUTIONS=cfa-cfa cfa-mandHead cpp-stlref lq-tailq
|
|---|
| 552 | results-fred-%.csv: MAKE_DISABLE_OBSERVATION=yes
|
|---|
| 553 | results-fred-%.csv: cleanbuild $(RESULT)
|
|---|
| 554 | mv $(RESULT) $@
|
|---|
| 555 |
|
|---|
| 556 | results-fred-linear.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_SHUFFLING_INDIRECTION -DDISABLE_ITERS
|
|---|
| 557 | results-fred-shuf.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_ITERS
|
|---|
| 558 | results-fred-iters.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING -DDISABLE_SHUFFLING_INDIRECTION
|
|---|
| 559 | results-fred-thesis.csv: EXTRA_COMP_FLAGS=-DDISABLE_INTERLEAVING
|
|---|