-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (56 loc) · 1.74 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#/bin/bash
NODES?=100
TIME?=1000
SEED?=420
ALPHA?=3
K?=5
LEVEL?=INFO
RATE?=0.1
IMGDIR?=img
LOGDIR?=logs
DATADIR?=res/data
PLOTDIR?=res/plots
EXT?=pdf
RATES?=0.01 0.02 0.05 0.1
main: help
clean:
@rm -f $(LOGDIR)/*.log
prepare: clean
@mkdir -p $(IMGDIR)
@mkdir -p $(LOGDIR)
@mkdir -p $(DATADIR)
@mkdir -p $(PLOTDIR)
run_chord: prepare
@echo "Running Chord with $(NODES) nodes for $(TIME) seconds, rate: $(RATE)"
@simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht CHORD --loglevel $(LEVEL) --rate $(RATE) --datadir $(DATADIR)
run_kad: prepare
@echo "Running Kad with $(NODES) nodes for $(TIME) seconds, rate: $(RATE)"
@simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht KAD --loglevel $(LEVEL) --alpha $(ALPHA) -k $(K) \
--rate $(RATE) --datadir $(DATADIR)
plot_chord:
@simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht CHORD --plot True --datadir $(DATADIR)
plot_kad:
@simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht KAD --plot True
plot:
@plot --nodes $(NODES) --time $(TIME) --singlerate $(RATE)
@echo "Plots completed."
plots: run_kad run_chord plot
plot_network: plot_chord plot_kad
plot_arrival_rate: prepare
@for rate in $(RATES); do \
echo "Rate: $$rate" ;\
echo "Running Kad";\
simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht KAD --loglevel $(LEVEL) --file $(DATADIR)/KAD_$(NODES)_$(TIME)_$$rate.json --rate $$rate; \
echo "Running Chord";\
simulate --nodes $(NODES) --max-time $(TIME) \
--seed $(SEED) --dht CHORD --loglevel $(LEVEL) --file $(DATADIR)/CHORD_$(NODES)_$(TIME)_$$rate.json --rate $$rate; \
done
@plot --arrivals --nodes $(NODES) --time $(TIME) --rates $(RATES)
@echo "Arrivals plot completed."
help:
@simulate --help