-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
201 lines (163 loc) · 7.41 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
TARGETS= $(COMPILE_TARGETS) test
COMPILE_TARGETS=main streamdump generate_stream
ifdef D
DEBUG=-g -DDEBUG_MODE
OPT=
else
DEBUG=
OPT=-Ofast
endif
ifdef NH
ARCH=
else
ARCH=-msse4.2 -D__SSE4_2_
endif
ifdef G
GREEDY=-DGREEDY
else
GREEDY=
endif
ifdef V
VALIDATE=-DVALIDATE
else
VALIDATE=
endif
ifdef P
PROFILE=-pg -no-pie # for bug in gprof.
endif
CXX = g++ -std=c++11
CC = gcc -std=gnu11
LD= g++ -std=c++11
LOC_INCLUDE=include
LOC_SRC=src
OBJDIR=obj
LOGDIR=logs
CXXFLAGS += -Wall $(DEBUG) $(PROFILE) $(OPT) $(ARCH) $(GREEDY) $(VALIDATE) \
-m64 -I. -I$(LOC_INCLUDE)
CFLAGS += -Wall $(DEBUG) $(PROFILE) $(OPT) $(ARCH) $(GREEDY) $(VALIDATE) \
-m64 -I. -I$(LOC_INCLUDE)
LDFLAGS += $(DEBUG) $(PROFILE) $(OPT) -lpthread -lssl -lcrypto -lm
#
# declaration of dependencies
#
all: $(TARGETS)
# dependencies between programs and .o files
main: $(OBJDIR)/main.o $(OBJDIR)/popcornfilter.o \
$(OBJDIR)/cascadefilter.o $(OBJDIR)/zipf.o \
$(OBJDIR)/gqf.o $(OBJDIR)/gqf_file.o $(OBJDIR)/util.o \
$(OBJDIR)/hashutil.o $(OBJDIR)/partitioned_counter.o
streamdump: $(OBJDIR)/streamdump.o $(OBJDIR)/gqf.o $(OBJDIR)/util.o \
$(OBJDIR)/hashutil.o
generate_stream: $(OBJDIR)/generate_stream.o $(OBJDIR)/util.o
test: $(LOGDIR)
./main popcornfilter -f 1 -q 16 -l 3 -g 2 -t 1 -a 1 -o -v 24
setup:
sudo apt install cgroup-tools libssl-dev
sudo cgconfigparser -l scripts/cgconfig.conf
firehose:
git clone https://github.com/splatlab/firehose.git
cd firehose/generators/active/; make; cd -
data_gen50M:
./streamdump -s 50000000 -f raw/streamdump_mmap_active_new_50M 12345 & \
./firehose/generators/active/active -n 1000000 -r 500000 -a 1048576 127.0.0.1@12345
popcorn50M:
echo "Scaling throughput for 50M dataset" > 50M_data.output
echo 33554432 > /var/cgroups/popcorning/memory.limit_in_bytes
echo "-f 8 -q 19 -l 3 -g 4 -t 1 -o -e -v 24" >> 50M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 8 -q 19 -l 3 -g 4 -t 1 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_50M >> 50M_data.output
echo "-f 8 -q 19 -l 3 -g 4 -t 2 -o -e -v 24" >> 50M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 8 -q 19 -l 3 -g 4 -t 2 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_50M >> 50M_data.output
echo "-f 8 -q 19 -l 3 -g 4 -t 3 -o -e -v 24" >> 50M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 8 -q 19 -l 3 -g 4 -t 3 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_50M >> 50M_data.output
echo "-f 8 -q 19 -l 3 -g 4 -t 4 -o -e -v 24" >> 50M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 8 -q 19 -l 3 -g 4 -t 4 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_50M >> 50M_data.output
data_gen500M:
./streamdump -s 500000000 -f raw/streamdump_mmap_active_new_500M 12345 & \
./firehose/generators/active/active -n 10000000 -r 500000 -a 1048576 127.0.0.1@12345
popcorn500M:
echo "Scaling throughput for 500M dataset" > 500M_data.output
echo 134217728 > /var/cgroups/popcorning/memory.limit_in_bytes
echo "-f 256 -q 16 -l 4 -g 4 -t 1 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 1 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
echo "-f 256 -q 16 -l 4 -g 4 -t 2 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 2 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
echo "-f 256 -q 16 -l 4 -g 4 -t 4 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 4 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
echo "-f 256 -q 16 -l 4 -g 4 -t 8 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 8 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
echo "-f 256 -q 16 -l 4 -g 4 -t 16 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 16 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
echo "-f 1024 -q 14 -l 4 -g 4 -t 32 -o -e -v 24" >> 500M_data.output
cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 32 \
-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#data_gen2B:
#./streamdump -s 2000000000 -f raw/streamdump_mmap_active_new_2B 12345 & \
#./firehose/generators/active/active -n 40000000 -r 500000 -a 1048576 127.0.0.1@12345
#popcorn2B:
#echo "Scaling throughput for 2B dataset" > 2B_data.output
#echo 134217728 > /var/cgroups/popcorning/memory.limit_in_bytes
#echo "-f 256 -q 16 -l 4 -g 4 -t 1 -o -e -v 24" >> 2B_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 1 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#echo "-f 256 -q 16 -l 4 -g 4 -t 2 -o -e -v 24" >> 500M_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 2 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#echo "-f 256 -q 16 -l 4 -g 4 -t 4 -o -e -v 24" >> 500M_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 4 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#echo "-f 256 -q 16 -l 4 -g 4 -t 8 -o -e -v 24" >> 500M_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 8 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#echo "-f 256 -q 16 -l 4 -g 4 -t 16 -o -e -v 24" >> 500M_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 16 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
#echo "-f 256 -q 16 -l 4 -g 4 -t 32 -o -e -v 24" >> 500M_data.output
#cgexec -g memory:popcorning ./main popcornfilter -f 256 -q 16 -l 4 -g 4 -t 32 \
#-o -e -v 24 -i raw/streamdump_mmap_active_new_500M >> 500M_data.output
# dependencies between .o files and .h files
$(OBJDIR)/main.o: $(LOC_INCLUDE)/popcornfilter.h
$(OBJDIR)/popcornfilter.o: $(LOC_INCLUDE)/popcornfilter.h \
$(LOC_INCLUDE)/cascadefilter.h
$(OBJDIR)/cascadefilter.o: $(LOC_INCLUDE)/cascadefilter.h \
$(LOC_INCLUDE)/gqf_cpp.h \
$(LOC_INCLUDE)/util.h \
$(LOC_INCLUDE)/lock.h \
$(LOC_INCLUDE)/partitioned_counter.h \
$(LOC_INCLUDE)/zipf.h
$(OBJDIR)/streamdump.o: $(LOC_INCLUDE)/gqf_cpp.h \
$(LOC_INCLUDE)/util.h \
$(LOC_INCLUDE)/lock.h
# dependencies between .o files and .cc (or .c) files
$(OBJDIR)/generate_stream.o: $(LOC_SRC)/generate_stream.cc
$(OBJDIR)/gqf.o: $(LOC_SRC)/gqf/gqf.c $(LOC_INCLUDE)/gqf/gqf.h
$(OBJDIR)/gqf_file.o: $(LOC_SRC)/gqf/gqf_file.c $(LOC_INCLUDE)/gqf/gqf_file.h
$(OBJDIR)/hashutil.o: $(LOC_INCLUDE)/gqf/hashutil.h
$(OBJDIR)/zipf.o: $(LOC_SRC)/zipf.c $(LOC_INCLUDE)/zipf.h
$(OBJDIR)/partitioned_counter.o: $(LOC_SRC)/partitioned_counter.c \
$(LOC_INCLUDE)/partitioned_counter.h
#
# generic build rules
#
$(COMPILE_TARGETS):
$(LD) $^ $(LDFLAGS) -o $@
$(OBJDIR)/%.o: $(LOC_SRC)/%.cc | $(OBJDIR)
$(CXX) $(CXXFLAGS) $(INCLUDE) -c -o $@ $<
$(OBJDIR)/%.o: $(LOC_SRC)/%.c | $(OBJDIR)
$(CXX) $(CFLAGS) $(INCLUDE) -c -o $@ $<
$(OBJDIR)/%.o: $(LOC_SRC)/gqf/%.c | $(OBJDIR)
$(CXX) $(CFLAGS) $(INCLUDE) -c -o $@ $<
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(LOGDIR):
@mkdir -p $(LOGDIR)
clean:
rm -rf $(OBJDIR) $(LOGDIR) firehose core $(TARGETS)