diff --git a/Racket/Makefile b/Racket/Makefile index ed6ae87..c131399 100644 --- a/Racket/Makefile +++ b/Racket/Makefile @@ -79,9 +79,10 @@ space := $(nullstring) # end of the line spaces-to-commas = $(subst $(space),$(comma),$(strip $(1))) # A selection of powers of two for the escalating -# iteration count. These start at one, and are multiplied by 2**3 each +# iteration count. These start at one, and are multiplied by 2**6 each # increase to derive the new number. # This variable is applied universally across the benchmarks. +#ITERATIONS = 1 8 64 512 4096 #32768 262144 2097152 16777216 ITERATIONS = 1 64 4096 #262144 16777216 # For most programs, this is the number of threads to be used. For @@ -138,12 +139,12 @@ define for_iters = endef bench_all: $(bench_names) +#bench_all: bench_commstime bench_montecarlopi bench_selecttime # bench_commstime works differently from the others, since, at present # at least, it only takes one parameter, meaning that hyperfine # can handle everything without resorting to an external for loop. bench_commstime: $(exes_dir)/commstime | $(benches_dir) - @echo benches_record_name = $(benches_record_name) $(hypw3) --parameter-list num_iters "$(call spaces-to-commas,$(ITERATIONS))" "$< {num_iters}" # Note that this one is different from most of the others in that it @@ -151,24 +152,75 @@ bench_commstime: $(exes_dir)/commstime | $(benches_dir) # as well as wrapping for_iters with another for loop. Unfortunately, # to get things to work, I need to use a variable named j in the loop # wrapping the one which uses the variable i... -bench_linalg: $(exes_dir)/linalg | $(benches_dir) +#~ bench_linalg: $(exes_dir)/linalg | $(benches_dir) +#~ for j in $(LINALG_OPTS); do\ +#~ $(for_iters);\ +#~ done + +bench_linalg: + make bench_linalg1 + make bench_linalg2 + +bench_linalg1 : iter_command = $(hypw3) --parameter-list vecs_size "$(call spaces-to-commas,$(VECTORS))" "$< $$j $$i {vecs_size}" +bench_linalg1 : VECTORS = 2 3 4 8 16 32 +bench_linalg1: $(exes_dir)/linalg | $(benches_dir) + for j in $(LINALG_OPTS); do\ + $(for_iters);\ + done + +bench_linalg2 : iter_command = $(hypw3) --parameter-list vecs_size "$(call spaces-to-commas,$(VECTORS))" "$< $$j $$i {vecs_size}" +bench_linalg2 : VECTORS = 128 +bench_linalg2 : ITERATIONS = 1 64 +bench_linalg2: $(exes_dir)/linalg | $(benches_dir) for j in $(LINALG_OPTS); do\ $(for_iters);\ done -bench_montecarlopi : THREADS = 2 16 128 1024 8192 bench_montecarlopi: $(exes_dir)/montecarlopi | $(benches_dir) $(for_iters) bench_selecttime: $(exes_dir)/selecttime | $(benches_dir) $(for_iters) +#~ bench_spawn: $(exes_dir)/spawn | $(benches_dir) +#~ $(for_iters) + bench_spawn: $(exes_dir)/spawn | $(benches_dir) + make bench_spawn1 + make bench_spawn2 + +bench_spawn1 : THREADS = 2 16 128 1024 +bench_spawn1 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$i {num_threads}" +bench_spawn1: $(exes_dir)/spawn | $(benches_dir) + $(for_iters) + +bench_spawn2 : THREADS = 8192 +bench_spawn2 : ITERATIONS = 1 64 +bench_spawn2 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$i {num_threads}" +bench_spawn2: $(exes_dir)/spawn | $(benches_dir) $(for_iters) # This has the same issues as bench_linalg - see the comment there. +#~ bench_whispers: $(exes_dir)/whispers | $(benches_dir) +#~ for j in $(WHISPERS_OPTS); do\ +#~ $(for_iters); \ +#~ done + bench_whispers: $(exes_dir)/whispers | $(benches_dir) - @echo benches_record_name = $(benches_record_name) + make bench_whispers1 + make bench_whispers2 + +bench_whispers1 : THREADS = 2 16 128 1024 +bench_whispers1 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$j $$i {num_threads}" +bench_whispers1: $(exes_dir)/whispers | $(benches_dir) + for j in $(WHISPERS_OPTS); do\ + $(for_iters); \ + done + +bench_whispers2 : THREADS = 8192 +bench_whispers2 : ITERATIONS = 1 64 +bench_whispers2 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$j $$i {num_threads}" +bench_whispers2: $(exes_dir)/whispers | $(benches_dir) for j in $(WHISPERS_OPTS); do\ $(for_iters); \ done @@ -192,7 +244,7 @@ clean_bench: clean_all: @make clean @make clean_bench - + ################################################## # Rules to ensure that the required sub-directories are in fact extant. @@ -200,7 +252,7 @@ clean_all: # question: https://stackoverflow.com/q/1950926 $(exes_dir): - mkdir -p $(exes_dir) + @mkdir -p $(exes_dir) $(benches_dir): - mkdir -p $(benches_dir) + @mkdir -p $(benches_dir) diff --git a/TypedRacket/Makefile b/TypedRacket/Makefile index 7882ddd..c131399 100644 --- a/TypedRacket/Makefile +++ b/TypedRacket/Makefile @@ -139,12 +139,12 @@ define for_iters = endef bench_all: $(bench_names) +#bench_all: bench_commstime bench_montecarlopi bench_selecttime # bench_commstime works differently from the others, since, at present # at least, it only takes one parameter, meaning that hyperfine # can handle everything without resorting to an external for loop. bench_commstime: $(exes_dir)/commstime | $(benches_dir) - @echo benches_record_name = $(benches_record_name) $(hypw3) --parameter-list num_iters "$(call spaces-to-commas,$(ITERATIONS))" "$< {num_iters}" # Note that this one is different from most of the others in that it @@ -152,24 +152,75 @@ bench_commstime: $(exes_dir)/commstime | $(benches_dir) # as well as wrapping for_iters with another for loop. Unfortunately, # to get things to work, I need to use a variable named j in the loop # wrapping the one which uses the variable i... -bench_linalg: $(exes_dir)/linalg | $(benches_dir) +#~ bench_linalg: $(exes_dir)/linalg | $(benches_dir) +#~ for j in $(LINALG_OPTS); do\ +#~ $(for_iters);\ +#~ done + +bench_linalg: + make bench_linalg1 + make bench_linalg2 + +bench_linalg1 : iter_command = $(hypw3) --parameter-list vecs_size "$(call spaces-to-commas,$(VECTORS))" "$< $$j $$i {vecs_size}" +bench_linalg1 : VECTORS = 2 3 4 8 16 32 +bench_linalg1: $(exes_dir)/linalg | $(benches_dir) + for j in $(LINALG_OPTS); do\ + $(for_iters);\ + done + +bench_linalg2 : iter_command = $(hypw3) --parameter-list vecs_size "$(call spaces-to-commas,$(VECTORS))" "$< $$j $$i {vecs_size}" +bench_linalg2 : VECTORS = 128 +bench_linalg2 : ITERATIONS = 1 64 +bench_linalg2: $(exes_dir)/linalg | $(benches_dir) for j in $(LINALG_OPTS); do\ $(for_iters);\ done -bench_montecarlopi : THREADS = 2 16 128 1024 8192 bench_montecarlopi: $(exes_dir)/montecarlopi | $(benches_dir) $(for_iters) bench_selecttime: $(exes_dir)/selecttime | $(benches_dir) $(for_iters) +#~ bench_spawn: $(exes_dir)/spawn | $(benches_dir) +#~ $(for_iters) + bench_spawn: $(exes_dir)/spawn | $(benches_dir) + make bench_spawn1 + make bench_spawn2 + +bench_spawn1 : THREADS = 2 16 128 1024 +bench_spawn1 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$i {num_threads}" +bench_spawn1: $(exes_dir)/spawn | $(benches_dir) + $(for_iters) + +bench_spawn2 : THREADS = 8192 +bench_spawn2 : ITERATIONS = 1 64 +bench_spawn2 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$i {num_threads}" +bench_spawn2: $(exes_dir)/spawn | $(benches_dir) $(for_iters) # This has the same issues as bench_linalg - see the comment there. +#~ bench_whispers: $(exes_dir)/whispers | $(benches_dir) +#~ for j in $(WHISPERS_OPTS); do\ +#~ $(for_iters); \ +#~ done + bench_whispers: $(exes_dir)/whispers | $(benches_dir) - @echo benches_record_name = $(benches_record_name) + make bench_whispers1 + make bench_whispers2 + +bench_whispers1 : THREADS = 2 16 128 1024 +bench_whispers1 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$j $$i {num_threads}" +bench_whispers1: $(exes_dir)/whispers | $(benches_dir) + for j in $(WHISPERS_OPTS); do\ + $(for_iters); \ + done + +bench_whispers2 : THREADS = 8192 +bench_whispers2 : ITERATIONS = 1 64 +bench_whispers2 : iter_command = $(hypw3) --parameter-list num_threads "$(call spaces-to-commas,$(THREADS))" "$< $$j $$i {num_threads}" +bench_whispers2: $(exes_dir)/whispers | $(benches_dir) for j in $(WHISPERS_OPTS); do\ $(for_iters); \ done