git.iko.soy/distributed-process
on ryan help sign in
76 lines 1.9 kB history raw
2# Makefile for building and running benchmarks.
3# Usage:
4# make all
5# make run
7#--------------------------------------------------------------------------------
8# Settings
10# By default, run 100K ping-pongs, for one trial:
11size = 100000
12trials = 1
13# Alternatively, you can run "make run1 size=1000 trials=100", for example.
15ifeq ($(GHC),)
16 GHC=ghc
17endif
19BENCHS= PingPongTCP.exe PingPongTCPTransport.exe
20# PingPongPipes.exe SendTransport.exe
22all: $(BENCHS)
23$(BENCHS): %.exe: %.hs
24 $(GHC) -O2 -rtsopts -threaded --make $(INCLUDES) $< -o $@
26#-------------------------------------------------------------------------------
27# Shorthands for running benchmarks:
29run: run1 run2
30# Disabled: run3 run4
32# Benchmark raw sockets without network-transport:
33run1: runBaseline
34runBaseline:
35 ./PingPongTCP.exe server 8080 &
36 sleep 1
37 time ./PingPongTCP.exe client 0.0.0.0 8080 $(size) $(trials)
38 # Kill the server:
39 killall PingPongTCP.exe
41run2: runTCP
42runTCP:
43 ./PingPongTCPTransport.exe server 0.0.0.0 8080 sourceAddr.txt &
44 sleep 1
45 # Run 100K ping-pongs, for one trial:
46 time ./PingPongTCPTransport.exe client 0.0.0.0 8081 sourceAddr.txt $(size) $(trials)
47 # Kill the server:
48# killall PingPongTCPTransport.exe
50run3: runPipes
51runPipes:
52 ./PingPongPipes.exe server sourceAddr &
53 sleep 1
54 time ./PingPongPipes.exe client sourceAddr $(size) $(trials)
55 # Kill the server:
56 killall PingPongPipes.exe
58# This benchmark measures throughput rather than latency
59# Here 'size' means message size rather than number of pings:
60run4: runTPT
61runTPT:
62 ./SendTransport.exe server 0.0.0.0 8080 sourceAddr &
63 sleep 1
64 ./SendTransport.exe client 0.0.0.0 8081 sourceAddr $(size)
65 killall SendTransport.exe
67# Run multiple sizes:
68runTPTs:
69 $(MAKE) runTPT size=1000
70 $(MAKE) runTPT size=5000
71 $(MAKE) runTPT size=10000
72 $(MAKE) runTPT size=50000
73 $(MAKE) runTPT size=100000
75clean:
76 rm -f *.hi *.o *.exe