git.iko.soy/distributed-process
on 478d769 help sign in
72 lines 1.8 kB history raw
2# Run 100K ping-pongs, for one trial:
3size = 100000
4trials = 1
5# You can run "make run1 size=1000 trials=100" for example.
8# Disable this to test installed packages only:
9INCLUDES= -i../network-transport/src -i../network-transport-pipes/src
11# Enable for profiling
12# PROFILING=-prof -fprof-auto
14ifeq ($(GHC),)
15 GHC=ghc
16endif
18BENCHS= PingTCP.exe PingTCPTransport.exe PingPipes.exe SendTransport.exe
20all: $(BENCHS)
21$(BENCHS): %.exe: %.hs
22 $(GHC) -O2 -rtsopts -threaded --make $(INCLUDES) $(PROFILING) $< -o $@
24#-------------------------------------------------------------------------------
25# Shorthands for running benchmarks:
27run: run1 run2 run3 run4
29run1: runBaseline
30runBaseline:
31 ./PingTCP.exe server 8080 &
32 sleep 1
33 time ./PingTCP.exe client 0.0.0.0 8080 $(size) $(trials)
34 # Kill the server:
35 killall PingTCP.exe
37run2: runTCP
38runTCP:
39 ./PingTCPTransport.exe server 0.0.0.0 8080 sourceAddr &
40 sleep 1
41 # Run 100K ping-pongs, for one trial:
42 time ./PingTCPTransport.exe client 0.0.0.0 8081 sourceAddr $(size) $(trials)
43 # Kill the server:
44 killall PingTCPTransport.exe
46run3: runPipes
47runPipes:
48 ./PingPipes.exe server sourceAddr &
49 sleep 1
50 time ./PingPipes.exe client sourceAddr $(size) $(trials)
51 # Kill the server:
52 killall PingPipes.exe
54# This benchmark measures throughput rather than latency
55# Here 'size' means message size rather than number of pings:
56run4: runTPT
57runTPT:
58 ./SendTransport.exe server 0.0.0.0 8080 sourceAddr &
59 sleep 1
60 ./SendTransport.exe client 0.0.0.0 8081 sourceAddr $(size)
61 killall SendTransport.exe
63# Run multiple sizes:
64runTPTs:
65 $(MAKE) runTPT size=1000
66 $(MAKE) runTPT size=5000
67 $(MAKE) runTPT size=10000
68 $(MAKE) runTPT size=50000
69 $(MAKE) runTPT size=100000
71clean:
72 rm -f *.hi *.o *.exe